- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 06:32 AM
Hi
I have a requirement where I need to trigger an email notification. On the email notification I need to mention due due, date which should be date on which event is fired ( which will trigger the same email notification) +7days.
I tried writing an email script but did not work, any suggestions would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 06:52 AM
I believe you know how to create and add email script to email body
Add like this (syntax below)
Script in email script
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var nowTime = new GlideDateTime();
nowTime.addDaysUTC(7);
template.print('Date is ' + nowTime.getDate());
})(current, template, email, email_action, event);
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-03-2025 06:52 AM
I believe you know how to create and add email script to email body
Add like this (syntax below)
Script in email script
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var nowTime = new GlideDateTime();
nowTime.addDaysUTC(7);
template.print('Date is ' + nowTime.getDate());
})(current, template, email, email_action, event);
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-03-2025 08:19 PM
Hope you are doing good.
Did my reply answer your question?
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-10-2025 10:30 PM
Hope you are doing good.
Did my reply answer your question?
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-10-2025 10:53 PM
Hi @Ankur Bawiskar it works ! Thank you
I have marked your response helpful