JavaScript in emails

concept brazil Updated Sep 10, 2026 1 min read c_UseJavaScriptInEmails.md
Raw file servicenow.com

Create mail scripts in System Notifications > Email > Notification Email Script, and refer to them by using ${mail_script:script name} in the script field.

To print text into the body of the message, use the template.print("a string") function.

[Omitted image "JavaScriptInTemplates.png"] Alt text:

The event.parm1 and event.parm2 parameters that come from the originating event can also be used.

For additional information on creating mail scripts, see Notification Email Scripts on the Developer Site.

Parent Topic:Scripting for email notifications

Related topics

Mail script variables

Example scripting for email notifications

Useful attachment scripts

Search documentation
Search document titles and file paths on the brazil branch