how to send 7 days email reminder in scheduled job?

Dizy M
Tera Expert

Hi .

I have this requirement that I need to send email reminders for 7 days if the employee doesn't answer the survey and need to send this starting tuesday. Once the survey is answered it will also stop sending email reminders

 

Does anyone know how to create this in a scheduled job?

 

I appreciate your help. Thank you!

 

3 REPLIES 3

Peter Bodelier
Giga Sage

Hi @Dizy M,

Please follow the steps below

  1. Create a new Event (Event > Registry) on Assessment Instance table
  2. Create a new Email > Notification for the assessment instance table) and associate the above event
  3. Ensure your notification has

    • Send to event Creator true
    • Event parm1 contains recipient as true
  4. Create schedule job which runs daily and checks the records and sends notification to the user

Script:

sendNotification();

function sendNotification(){

try{
var gr = new GlideRecord('asmt_assessment_instance');
gr.addEncodedQuery('stateINready,wip^userISNOTEMPTY');
gr.query();
while (gr.next()) {
	gs.eventQueue('event_name', gr, gr.user, '');
}
}
catch(ex){
gs.info(ex);
}

}

PeterBodelier_0-1694003985094.png

 

PeterBodelier_1-1694003985104.png

 

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Hi @Peter Bodelier thank you for sharing this however i have like 7 email reminders , they  have different subject because for the 1st reminder the subject is like "Reminder 1 " so  on and so forth  but the email body are the same.

Peter Bodelier
Giga Sage

Easiest is to create 7 events, and link each notification to the corresponding one.

You could also do it by setting the second event parameter to a certain value, and fill the subject based on that by using a mail script in the notification.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.