How can I set up a Survey reminder?

Allison3
Kilo Guru

I'm needing to setup a reminder email for users when the survey expires the next day. I have read through the community and setup what I think I need but it's still not working.

 

I have a Event setup called task.send_survey_reminder

find_real_file.png

 

I then have an email notification setup to send when the event is fired. I have surveys that are set to expire tomorrow but the email is not going out. I checked the event log and I don't see it. What am I missing?

find_real_file.png

 

1 ACCEPTED SOLUTION

You need to query for any surveys that have not yet been completed. To do that, use GlideRecord. Something like this: 

 

var survey = new GlideRecord('asmt_assessment_instance');
survey.addEncodedQuery('state=ready^due_dateONTomorrow@javascript:gs.beginningOfTomorrow()@javascript:gs.endOfTomorrow()^userISNOTEMPTY');
survey.setLimit(1); //limiting the query to just one record
survey.query();

while (survey.next()) {
	gs.eventQueue('task.send_survey_reminder', survey);
}

View solution in original post

16 REPLIES 16

Does it write to the Event log? To verify, go to System Logs > Events. Filter by the event name and sort by date. 

Yep, It's writing to the event log. So that part seems to be working. Now to get the email to trigger. 

I updated the email notification and it's now working!!! Thanks so much for your help!

Glad to hear!

Any help on how I can make this when the due date is in the next 2 days? These expire after 5 days. On day 3 I want the email to go out that the survey is going to expire in 2 days.