Skip to content
Release: Australia · Updated: 2026-05-04 · Official documentation · View source

Include mail scripts in email notifications

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 and Notification Email Scripts on the developer site.

Procedure

  1. Navigate to All > System Notification > Email > Notifications.

  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.
    • To enter a mail script manually, add the script and enclose it within the <mail_script> and </mail_script> tags.
    • On the form header, right-click and select Save.
  4. 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}.

Mail scripts embedded in an email notification

Image omitted: example-mail-script-notification.png
Message HTML field displaying mail script tags in an email notification

Parent Topic:Scripting for email notifications

Related topics

Mail script variables

Example scripting for email notifications

Useful attachment scripts