- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 08:37 PM
Hi Experts!
Good day everyone. My team and I require advice on how to insert Current year (e.g.: 2026) in our email subject & content.
For example:
Subject: Annual Review 2026 |
Message: Hi All, kindly review your RCSA for 2026 |
We have this email scheduled for every year but need expert's help on how to insert the current year in Subject and Message for email notification configuration in "What it will contain" section. Thank you so much for your kindness, time and support.
Thanks and I really appreciate it!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 08:06 PM
you can include email script in your email body using this syntax
${mail_script:mailScriptName}
check this for further help
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
06-04-2025 06:54 AM
Hi @AdamSaniS
https://www.servicenow.com/community/itsm-forum/email-script-needs-to-show-current-year/m-p/2513204
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 06:59 AM
you will have to use email script to set the subject with the current year etc
Don't set it via notification level.
Something like this
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var currentYear = new GlideDateTime().getYearUTC();
var subject = 'Annual Review ' + currentYear;
email.setSubject(subject);
})(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
06-04-2025 07:05 PM
Hi Ankur,
Many thanks for your response. I have tried to do email script before, but it failed to reflect when I put the script into my email message. How do I reflect the email script into my notification message? Thank you so much for your help - I feel so grateful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 08:06 PM
you can include email script in your email body using this syntax
${mail_script:mailScriptName}
check this for further help
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