Configure Email Templates
Create customized email templates and use them to send notification emails for human task and notify task activities. You can copy an existing email template and modify it as per requirements.
In this topic, you can learn:
Create an Email Template for Human Tasks
You can create an email template by manually entering the HTML markup directly into the code editor provided in the Create an Email Template pane.
To create a new email template:
-
Open a process in the process editor.
-
Select a human task activity, and click Notifications
on the right side of the process editor.
-
In the Notification pane, go to Manage Email Templates, and click
.
The Create an Email Template pane opens.
-
Enter the HTML markup for your email template in the space provided for it.
To include values from process variables and form arguments, you'll use mustache templates. Mustache templates provide a way to include predefined task variables, and values in an HTML markup. The following example shows how to reference the first name and last name with a data object using the mustache template:
Template:
{{#payload}}{{#DOName}}{{AttributeName}}{{/DOName}}{{/payload}}
Object:
<div class="container"> <div class="label">Hello {{#payload}}{{#DOName}}{{firstName}}{{/DOName}}{{/payload}} {{#payload}}{{#DOName}}{{lastName}}{{/DOName}}{{/payload}} </div> </div>
Note:
To use values from process or task variables that are not predefined, associate the variables with a data object before referencing them as shown in the example.Output:
Hello Joe Smith
-
Click Preview to view your template before finalizing it.
Note:
In preview mode, the payload and action map sections don’t show the data.
Predefined variables of human task email notification
The following table provides a description of the predefined variables that you can use in a human task email notification template. Note that the variable names are case-sensitive.
You can refer the variables using the following format:
{{name_of_the_predefined_variable}}
For example:
{{title}}, {{assignee}}
Variable | Description | Syntax |
---|---|---|
|
On Assign: user name of the task assignee |
{{assignee}} |
approverComment |
Stores the last comment against the task . | {{approverComment}} |
assigneeDisplayName |
On Assign: user display name of the task assignee | {{assigneeDisplayName}} |
|
List of actions. |
{{ actions }} For example:
|
|
Display name of the action. For example, Approve, Reject. |
You can define the action display name as shown in the following syntax:
|
|
Date of creation of the task |
{{createdDate}} |
creatorDisplayName |
Stores the display name of the creator. | {{creatorDisplayName}} |
creatorName |
Stores the username of the creator. | {{creatorName}} |
|
Due date for completing the task |
{{dueDate}} |
expirationDate |
Expiry date of a task. | {{expirationDate}} |
externalUIURL |
Stores the URL of the external user interface used by the task. | {{externalUIURL}} |
fromUserDisplayName |
Stores the display name of the user.
|
{{fromUserDisplayName}} |
fromUserName |
Stores the user name of the user. |
{{fromUserName}} |
|
A Boolean value that indicates if an action is configured for a task. |
{{hasActions}} |
instanceId |
ID of the process instance in which the task is present. | {{instanceId}} |
|
Logo. |
{{logo}} |
outcome |
The outcome of the task. | {{outcome}} |
|
The priority of the task. |
{{priority}} |
|
Root element that stores all user defined data objects. |
{{payload}} |
processName |
Name of the process in which the task is present. | {{processName}} |
processVersion |
Version of the process in which the task is present. | {{processVersion}} |
|
The task summary. |
{{shortSummary}} |
state |
The current state of the task like whether it is assigned or completed. | {{state}} |
subState |
The current substate of the task. For excample, this variable can indicate if the task is expired. | {{subState}} |
|
The task ID. |
{{taskId}} |
|
Title of the task |
{{title}} |
|
URL for accessing the task details in runtime. |
{{url}} |
|
Display name of the user who updated the task. |
{{updatedBy}} |
updatedById |
Stores the username of the user who has updated the task. | {{updatedById}} |
|
Date on which the task was last updated. |
{{updatedDate}} |
Predefined payload data and variables in human task notifications
Process Automation uses Mustache templates to display data. See Mustache and Mustache 5.
To define a… | Example |
---|---|
Variable |
Reference the predefined variables as shown in the following format:
To use multiple predefined variables, use comma as a separator. For example:
See the list of supported predefined variables. |
Payload |
To get the structure of the payload, see the incoming webform dataObject in the Data Association page of the human task activity. You can reference the following:
Payload example 1: Format of a Form with form and business data objects
Payload example 2: Form with form and business data objects using HTML tags
Payload example 3: Referring data objects and task variables in a table
In this table:
|
Array loops |
You can define arrays containing information in the form of elements. You can define the elements at different levels. For example the following screenshot shows how to define employee information at the second level.
Sample code to define array at second level. In this sample code, the employee name, age and experience details are defined as elements at the second level.
|
Create an Email Template for Notify Tasks
If you have an email template, you can manually enter the HTML markup directly into the code editor provided in the Create an Email Template pane and modify the markup as per requirements.
To reference data objects in the email template, you can use any of the following code formats:
-
Reference using an object:
Format
{{#payload}}{{#DOName}}{{AttributeName}}{{/DOName}}{{/payload}}
Object:
<div class="container"> <div class="label">Hello {{#payload}}{{#DOName}}{{firstName}}{{/DOName}}{{/payload}} {{#payload}}{{#DOName}}{{lastName}}{{/DOName}}{{/payload}} </div> </div>
-
Reference using an array loop:
The following sample code shows the employee name, age and experience details defined as elements at the second level.
{{#payload}}{{#secondLevelListDO}}{{#secondLevelList}}{{#employee}} <li>Employee Name:{{empName}}<br>Employee experience: {{empExp}}<br>Employee age:{{empAge}}</li> {{/employee}}{{/secondLevelList}}{{/secondLevelListDO}}{{/payload}}
Here is an example:
-
Directly referencing the data object (Deprecated from April 2025):
Format
${DOName.prop('AttributeName')}
For example:
${loanApplicationDataObject.prop('loanAmount')}
Note:
Email templates for notify tasks do not support:
- Referencing process variables that are not part of a data
object.
Note:
To use values from process or task variables that are not predefined, associate the variable values with a user defined data object before referencing. - Predefined variables
- Array data in data objects