Sending mail
You can use a mail template to send emails from a workflow.
About this task
A mail template optionally has tokens that consist of two parts: a dollar sign ($) and
a token number. An example of a token is $3. The workflow system replaces each token with the
corresponding element from an array of string values that is passed with the
templateVals parameter. Mail templates are subject to the following requirements:
- The mail template is checked into an object store and referenced in the workflow with an attachment field.
- Token numbering begins with 1 and is sequential.
- If a dollar sign in the template is not used as a token indicator, it is properly encoded
in HTML as
$. - If a dollar sign is passed as part of a templateVals parameter value, it is either properly encoded in HTML or escaped in the following manner: “\\$”. Also, as shown in the following example, at least one space exists between an escaped dollar sign and a number: “\\$ 2”.
Here is an example of a template:

Procedure
To send an email with a mail template: