- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 02:57 AM
My question is if I have to send lets say 3 reminder email for a particular RITM until it is approved , do i have to create 3 different notifications stating Reminder 1,2,3?
in the body or subject line we would like to add that it's a reminder email but i am not sure if there's any way where i can utilize current notification for reminder purpose also ,or do i have to create different template for all 3 reminders?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 03:24 AM
@Shivangi Singh2
In the param 1 or param 2, pass the stringified JSON objects.
{
"approver": "Approver detais",
"subject": "Reminder 1"
}
Then in your email script, parse the JSON and use it as required.
var obj = JSON.parse(event.param2);
var approver = obj.approver;
var subject = obj.subject;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 03:41 AM
Hello @Shivangi Singh2 ,
You only need a single Notification. You can pass the reminder number as a parameter and then based on whether it's 1, 2 or 3 you can have different subjects or messages in the email.
Example:
Create an Email Script, e.g. "my.approval.reminder":
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var parameters = JSON.parse(event.parm1);
var reminderNumber = parameters.reminderNumber;
email.subject = 'Reminder #' + reminderNumber;
if (reminderNumber === 1) {
template.print('This is the first reminder.');
}
})(current, template, email, email_action, event);
Include the above Email Script in the Message field of the Notification:
${mail_script:my.approval.reminder}
Then trigger the event that triggers the above Notification like this:
var parameters = {
ritmSysId: '...',
reminderNumber: 1
};
var approverSysId = '...';
gs.eventQueue('my.approval.reminder', current, JSON.stringify(parameters), approverSysId);
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 03:24 AM
@Shivangi Singh2
In the param 1 or param 2, pass the stringified JSON objects.
{
"approver": "Approver detais",
"subject": "Reminder 1"
}
Then in your email script, parse the JSON and use it as required.
var obj = JSON.parse(event.param2);
var approver = obj.approver;
var subject = obj.subject;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 03:18 AM
you can send extra details in parm2 and then use email script to determine which reminder the email triggered for
then print the appropriate content
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 03:35 AM
check this link
ARTICLE: Approval Reminder Email using Scheduled Job and Notification Email Script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 03:41 AM
Hello @Shivangi Singh2 ,
You only need a single Notification. You can pass the reminder number as a parameter and then based on whether it's 1, 2 or 3 you can have different subjects or messages in the email.
Example:
Create an Email Script, e.g. "my.approval.reminder":
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var parameters = JSON.parse(event.parm1);
var reminderNumber = parameters.reminderNumber;
email.subject = 'Reminder #' + reminderNumber;
if (reminderNumber === 1) {
template.print('This is the first reminder.');
}
})(current, template, email, email_action, event);
Include the above Email Script in the Message field of the Notification:
${mail_script:my.approval.reminder}
Then trigger the event that triggers the above Notification like this:
var parameters = {
ritmSysId: '...',
reminderNumber: 1
};
var approverSysId = '...';
gs.eventQueue('my.approval.reminder', current, JSON.stringify(parameters), approverSysId);
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 04:29 AM
Thank you so much for the help @Robert H . I will try this solution and reply here