Setup
Go to Setup > Notification Service
2. Add New, give the task a name, define time and date settings. On Task Schedule tab, for Date setting > Repeat on Dates set the option “Daily“. Option “Repeat during the day“ should be off. For more details on the settings, please check Notification Service#ScheduleTask
3. Under the Notification E-mails tab, define Sender email and name.
Set the option “Dynamic from database“.
Set #Email in Field identifying email address and enter E-mail subject:
4. Insert Email Body. Note that you can insert screenshots, links and signatures to the mail body.
SQL Script
select
distinct
p01.pin #pin,
FORMAT (p01.EMPLOYMENTSTARTDATE, 'dd/MM/yyyy') #Employmentstartdate,
p01.firstname #Firstname,
p01.lastname #Surname,
org.name #Organization,
c02.name #Rank,
'itsupport@pxgeo.com, hr@pxgeo.com, ehsq.support@pxgeo.com,payroll@pxgeo.com' #email,
'helen.ustych@adonishr.com' as #TestEmail
from
pw001p01 p01
join pworg org on org.numorgid=p01.client
left join pw001c02 c02 on c02.code=p01.RANK
where (select (CREATETIME) from PW001P01 where PIN = p01.PIN)>dateadd(HOUR,-24,GETUTCDATE())