---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# JavaScript in emails

# JavaScript in emails {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Create mail scripts in System NotificationsEmailNotification 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.  
Figure 1. JavaScript in templates

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.
**Related reference**   

* [Mail script variables](https://servicenow-prod.fluidtopics.net/DVv1NBh8ZyTXXC2o1Bq~OQ "Certain variables are available when processing mail_script scripts.")
* [Example scripting for email notifications](https://servicenow-prod.fluidtopics.net/mheYxg9vbpnk0LSyCTrMug "Examples of scripting for email notifications.")
* [Useful attachment scripts](https://servicenow-prod.fluidtopics.net/vU~ZKZWO6_Kfrfcg~rlxXQ "This is a searchable version of the Useful Attachment Scripts.")

*[\>]: and then


