Email scripts allow for business rule-like scripting within an outbound email message.

With mail scripts, you can dynamically change the email output of your system based on different criteria. Mail scripts allow you to perform simple tasks, such as displaying incident data, and complex ones, such as making advanced database queries.

You can add a ${mail_script:script name} embedded script tag to the body of the email notification or template, replacing script name with the name of the script you created. This makes it easy to use the same scripts in multiple email notifications or templates.

If you manually enter a mail script bounded by <mail_script> and </mail_script> in the body of a new or converted email notification or template, and then attempt to save the record, a message asks whether the mail script should be converted. In many cases, an unconverted mail script fails to run from inside the HTML editor. If you select Yes, the script is added to the Email Script [sys_script_email] table and is automatically replaced in the body with an embedded script tag (${mail_script:script_name}).