How to include current date in the HTML of an email notification.

bwinters
Kilo Contributor

I have a notification that runs when an event is fired. I am trying to include the current date and time in the body of the email.

6 REPLIES 6

Prateek kumar
Mega Sage

you just have to include var gt = new GlideDateTime(); in your notification or email notification script
https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GS-nowDateTime


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

this did not work. I tried to include in the "Message HTML" of the notification.

You have to cerate a mail script and include that name like below

Time: ${mail_script:script_name}

https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/script/server-scripting/concept/c_ScriptingForEmailNotifications.html

https://community.servicenow.com/community?id=community_question&sys_id=61fb4325db9cdbc01dcaf3231f961981

 


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

vinothkumar
Tera Guru

You can simply use mailscript and use gs.now(); which will give you current date