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 |
---|---|---|
|
Username of the task assignee. |
|
|
List of actions. |
You can define the actions as shown in the following syntax:
|
|
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}} |
|
Stores the username of the creator. |
{{creator}} |
|
Due date for completing the task |
{{dueDate}} |
expirationDate |
Expiry date of a task. | {{expirationDate}} |
|
A Boolean value that indicates if an action is configured for a task. |
{{hasActions}} |
|
Logo |
{{logo}} |
|
Task priority |
{{priority}} |
|
Map of task payload |
{{payload}} |
|
Task summary |
{{shortSummary}} |
|
Task ID |
{{taskId}} |
|
Title of the task |
{{title}} |
|
URL for accessing the task details in runtime. |
{{url}} |
|
Username of the user who updated the task. |
{{updatedBy}} |
|
Date the task was 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
|
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, use the following code 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