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

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Include mail scripts in email notifications

# Include mail scripts in email notifications {#ariaid-title1}

Release version: Australia  
Updated May 4, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Include mail scripts to customize email notifications, which enable you to apply conditional logic and insert dynamic record data in your notifications.

## Before you begin

Role required: admin

## About this task

For more information about using scripts with email notifications, see [Scripting for email notifications](https://servicenow-prod.fluidtopics.net/swJw1BighQKIHFtKFSjCdg "Use mail scripts to add business rule-like scripting to outbound email messages.") and [Notification Email Scripts](https://developer.servicenow.com/dev.do#!/learn/learning-plans/australia/servicenow_administrator/app_store_learnv2_automatingapps_australia_notification_email_scripts) on the developer site.

## Procedure

1. Navigate to AllSystem NotificationEmailNotifications.
2. Select and open the email notification where you want to include the mail script.
3. In the Message HTML field on the What it will contain tab, either embed an existing mail script or enter a mail script manually.
   * To embed an existing mail script if you do not have HTML sanitizer configured, add `${mail_script:script_name}`. If you have HTML sanitizer configured, add `${{mail_script:script_name}}` to apply HTML sanitization and help avoid security concerns in your HTML content. For more information, see [Configuring HTML sanitizer](https://www.servicenow.com/docs/access?context=t_ConfigureHTMLSanitizer&version=australia&pubname=australia-platform-security&ft:locale=en-US).
   * To enter a mail script manually, add the script and enclose it within the `<mail_script>` and `</mail_script>` tags.
   {#use-mail-scripts-email-notifications__choices_brq_k3s_pjc}
4. On the form header, right-click and select Save.
5. If you manually added a mail script in the Message HTML field, select Yes in the configuration dialog box that appears.  
   The script is added to the Email Script \[sys_script_email\] table and replaced in the Message HTML field with an embedded script tag: `${mail_script:script_name}`.
{#use-mail-scripts-email-notifications__steps_em2_r3v_qjc}

## Mail scripts embedded in an email notification {#use-mail-scripts-email-notifications__example_rlm_ywz_pjc}

**Related reference**   

* [Mail script variables](https://servicenow-prod.fluidtopics.net/JM~28u64ewPmqf15~0f8_w "Certain variables are available when processing mail_script scripts.")
* [Example scripting for email notifications](https://servicenow-prod.fluidtopics.net/GQ1RuzjMkPcJnm0wsk7IBA "Examples of scripting for email notifications.")
* [Useful attachment scripts](https://servicenow-prod.fluidtopics.net/h_CW0hlZ9NdG~7XAuQ2acA "This is a searchable version of the Useful Attachment Scripts.")

*[\>]: and then


