JavaScript in emails
concept brazil Updated Sep 10, 2026 1 min read c_UseJavaScriptInEmails.md
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
36 lines · 1.6 KB
---
title: JavaScript in emails
description: Create mail scripts in System Notifications Email Notification Email Script , and refer to them by using $\{mail\_script:script name\} in the script field.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/platform-administration/c\_UseJavaScriptInEmails.html
release: brazil
topic_type: concept
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Scripting for email notifications, Create an email notification, Email and SMS notifications, System notifications, Notifications, Configure core features, Administer the ServiceNow AI Platform]
---
# JavaScript in emails
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](https://developer.servicenow.com/dev.do#!/learn/learning-plans/washingtondc/servicenow_administrator/app_store_learnv2_automatingapps_washingtondc_notification_email_scripts) on the Developer Site.
**Parent Topic:**[Scripting for email notifications](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/platform-administration/c_ScriptingForEmailNotifications.md)
**Related topics**
[Mail script variables]()
[Example scripting for email notifications]()
[Useful attachment scripts]()
| title | JavaScript in emails |
| description | Create mail scripts in System Notifications Email Notification Email Script , and refer to them by using $\{mail\_script:script name\} in the script field. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/platform-administration/c\_UseJavaScriptInEmails.html |
| release | brazil |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Scripting for email notificationsCreate an email notificationEmail and SMS notificationsSystem notificationsNotificationsConfigure core featuresAdminister the ServiceNow AI Platform |