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.

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:

  1. Open a process in the process editor.

  2. Select a human task activity, and click Notifications Notification iconon the right side of the process editor.

  3. In the Notification pane, go to Manage Email Templates, and click Add email template.

    The Create an Email Template pane opens.

    Description of create-email-template.png follows
    Description of the illustration create-email-template.png

  4. 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

    See Defining tags using mustache templates.

  5. Click Preview to view your template before finalizing it.


    Preview your template

    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

assignee

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}}

actions

List of actions.

{{ actions }}

For example:

{{# hasActions }}
    <div class="button-container">
        <div class="label">Actions</div>
        <div class="buttons">
            {{# actions }}
                <a class="action-button" href="{{workspaceURL}}">
                    <span title="{{actionDisplayName}}">{{actionDisplayName}}</span>
                </a>
            {{/ actions }}
        </div>
    </div>
{{/ hasActions }}

actionDisplayName

Display name of the action. For example, Approve, Reject.

You can define the action display name as shown in the following syntax:

{{# hasActions }}
    <div class="button-container">
        <div class="label">List of Task Actions</div>
        <div class="buttons">
            {{# actions }}
                <a class="action-button" href="{{workspaceURL}}">
                    <span title="{{actionDisplayName}}">{{actionDisplayName}}</span>
                </a>
            {{/ actions }}
        </div>
    </div>
{{/ hasActions }}

createdDate

Date of creation of the task

{{createdDate}}
creatorDisplayName Stores the display name of the creator. {{creatorDisplayName}}
creatorName Stores the username of the creator. {{creatorName}}

dueDate

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.

  • On Assign: Creator of the task.

  • On Complete: Approver of the task.

  • On Reassign:Origin User.

  • On Escalation: Origin User.

  • On Request Info: Origin User.

{{fromUserDisplayName}}
fromUserName

Stores the user name of the user.

{{fromUserName}}

hasActions

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.

{{logo}}
outcome The outcome of the task. {{outcome}}

priority

The priority of the task.

{{priority}}

payload

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}}

shortSummary

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}}

taskId

The task ID.

{{taskId}}

title

Title of the task

{{title}}

url

URL for accessing the task details in runtime.

{{url}}

updatedBy

Display name of the user who updated the task.

{{updatedBy}}
updatedById Stores the username of the user who has updated the task. {{updatedById}}

updatedDate

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:

{{title}}

To use multiple predefined variables, use comma as a separator. For example:

{{title}}, {{assignee}}

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:

  • Process level data objects
  • Form argument data objects
  • User defined data objects
.

Payload example 1: Format of a Form with form and business data objects

{{#payload}}{{#formDO}}{{inputText1}}{{/formDO}}{{/payload}}
{{#payload}}{{#myFormArgs1}}{{inputText2}}{{/myFormArgs1}}{{/payload}}
{{#payload}}{{#myFormArgs2}}{{inputText3}}{{/myFormArgs2}}{{/payload}}

Payload example 2: Form with form and business data objects using HTML tags

<div class="info">
            <div class="container">
                <div class="label">Loan Application 1</div>
                <div class="value">{{#payload}}{{#appDataObject}}{{appName}}{{/appDataObject}}{{/payload}}</div>
            </div>
            <div class="container">
                <div class="label">Loan Application 2</div>
                <div class="value">{{#payload}}{{#myFormArgs}}{{appStatus}}{{/myFormArgs}}{{/payload}}</div>
            </div>
            <div class="container">
                <div class="label">secondLevel</div>
                <div class="value">{{#payload}}{{#accessSecondLevelValue}}{{#firstLevel}}{{secondLevel}}{{/firstLevel}}{{/accessSecondLevelValue}}{{/payload}}</div>
            </div>
            <div class="container col">
                <div class="created">
                    <div class="label">Created On</div>
                    <div class="value">{{createdDate}}</div>
                </div>
                <div>
                    <div class="label">Due Date</div>
                    <div class="value amber">{{dueDate}}</div>
                </div>
            </div>
            <div class="container link">
                <a class="view-link" href="{{url}}"> View in Browser</a>
                <div class="underline"></div>
            </div>
        </div>

Payload example 3: Referring data objects and task variables in a table

<table border="1">
  <thead>
    <tr>
      <th>Loan Application Name</th>
      <th>Outcome</th>
      <th>Task created date</th>
	  <th>Customer Name</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{#payload}}{{#appDataObject}}{{appName}}{{/appDataObject}}{{/payload}}</td>
      <td>{{outcome}}</td>
      <td>{{createdDate}}</td>
      <td>{{#payload}}{{#myFormArgs}}{{customerName}}{{/myFormArgs}}{{/payload}}</td>
    </tr>    
  </tbody>
</table>

In this table:

  • {{outcome}} and {{createdDate}} are task variables.
  • {{appName}} is the value from the data object.
  • {{#payload}}{{#myFormArgs}}{{customerName}}{{/myFormArgs}}{{/payload}} is the value from form arguments data object.
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.


Array loop for human task email notification

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.

{{#payload}}{{#secondLevelListDO}}{{#secondLevelList}}{{#employee}}
<li>Employee Name:{{empName}}<br>Employee experience: {{empExp}}<br>Employee age:{{empAge}}</li>
{{/employee}}{{/secondLevelList}}{{/secondLevelListDO}}{{/payload}}

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:


    Array loop for human task email notification

  • 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