Configure Email Templates
Create customized email templates and use them to send notification emails for human task activities. Upload email templates from your local drive, edit or copy existing email templates, or download email templates for your use.
Create an Email Template
You can create email templates by uploading a file with an HTM or HTML extension, or 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 data, you’ll use mustache templates. Mustache templates are logic-less and work by expanding tags in a template using values provided in an object—the task object in this case. These templates provide an easy way to include data references in an HTML file. The following example shows how to reference the first name and last name using the mustache template:
Template:
<p>Hello {{first_name}} {{last_name}}</p>
Object:
{ "first_name": "Joe", "last_name": "Smith" }
Output:
<p>Hello Joe Smith</p>
See Mustache and Mustache 5.
The following table provides a description of the task related attributes of the task object. Note that the variable names are case-sensitive.
Variable Description acquiredBy
Name of the user who has acquired the task
acquiredById
ID of the user who has acquired the task
assignedDate
Date when the task was assigned
createdDate
Date of creation of the task
creator
Creator of the task
creatorId
ID of the creator of the task
dueDate
Due date for completing the task
endDate
Date when the task must end
fromUser
Creator or user who reassigned the task
fromUserId
ID of the user from whom the task was acquired
longSummary
Detailed description of the task
outcome
Task outcome
ownerGroup
Group to which the task owner belongs
ownerRole
Role of the task owner
ownerUser
User who owns the task
ownerGroupId
ID of the group to which the task owner belongs
ownerRoleId
ID of the role of the task owner
ownerUserId
ID of the user who owns the task
priority
Task priority
payload
Map of task payload
priorityNum
Priority number of the task
shortSummary
Short summary of the task
startDate
Start date of the task
state
Current status of the task
taskId
Task ID
taskNumber
Task number
taskDefinitionId
Definition ID of the task
title
Title of the task
updatedBy
Name of the user who has updated the task
updatedById
ID of the user who has updated the task
updatedDate
Date when the task was updated
externalUIURL
URL of the external UI used by the task
The following table provides a description of the process related attributes of the task object:
Variable Description instanceId
ID of the process instance in which the task is present
processId
ID of the process in which the task is present
processName
Name of the process in which the task is present
processVersion
Version of the process in which the task is present
The following table provides a description of the application related attributes of the task object:
Variable Description assignee
Full name of the task assignee
currentYear
Current year
logo
Oracle logo
url
URL for accessing the task details in runtime
The following table provides a description of the comments related attributes of the task object:
Variable Description comments
List of comments
commentStr
Actual comment
updatedBy
Name of the user who updated the comment
updatedDate
Date the comment was updated
The following table provides a description of the action related attributes of the task object:
Variable Description actionDisplayName
Display name of the action. For example, Approve, Reject.
actionName
Name of the action defined in task action. For example, APPROVE, REJECT. Note that the action name is case sensitive and must match the task outcome.
actions
List of actions.
url
URL for performing the action.
Examples:
The following table provides examples of how to define tags using mustache templates:
To define a… Example Variable
{{title}}, {{assignee}}
Section/List
{{#comments}} {{commentStr}} {{updatedBy}} at {{updatedDate}} {{/comments}}
Null check
{{#dueDate}} Due Date: {{dueDate}} {{/dueDate}}
HTML string
{{{actions}}}
Payload
Use the camelCase naming convention for all business objects and form keys used in the payload to get the desired email template.
Payload Example for a Form with Business Object
{{#payload}} {{#financialApprovalForm}} <td valign="top">{{contractCategory}}</td> <td valign="top">{{creditLimit}}</td> {{#contractDataObject}} <td valign="top">{{customerName}}</td> <td valign="top">{{contractStartDate}}</td> <td valign="top">{{creditLimit}}</td> {/contractDataObject}} {{/financialApprovalForm}} {{/payload}}
You can view the structure of payload in the Data pane on the web form page.
Description of the illustration webform.pngPayload Example for a Form with Text and Boolean Data
{{#payload}} {{#travelRequestForm}} {{#form}} <td valign="top">{{name}}</td> <td valign="top">{{customerName}}</td> <td valign="top">{{totalAmount}}</td> <td valign="top">{{country}}</td> <td valign="top">{{city}}</td> <td valign="top">{{purposeOfVisit}}</td> {{/form}} {{/travelRequestForm}} {{/payload}}
To get the structure of the payload, see the incoming webform dataObject in the Data Association page of the human task activity.
Description of the illustration basic2.pngPayload Example for Form with Array Data and Business Object
{{#payload}} {{#basicForm}} {{#form}} <td valign="top">{{firstName}}</td> <td valign="top">{{lastName}}</td> {{#expensesItem}} <td valign="top">{{description}}</td> <td valign="top">{{amount}}</td> {/expensesItem}} {{/form}} {{#invoice}} <td valign="top">{{id}}</td> {{/invoice}} {{/basicForm}} {{/payload}}
Actions
You can define actions using a string, a list, or a map.
-
Actions as a string: In this case, actions are defined as per the default email. You can’t modify the look and feel of the links.
For example:{{{actions}}}
-
Actions as a list: Use it if you want to iterate over each action to modify the look and feel of links. The same setting is applied on all the links. For example:
{{#actionsList}} <a href="{{url}}"> {{actionDisplayName}}</a> {{/actionsList}}
-
Actions as a map: Use it if you want to customize each action link. For example:
{{#actionsMap}} {{#APPROVE}} <a href="{{url}}" style="background-color: green;”> {{actionDisplayName}}</a> {{/APPROVE}} {{#REJECT}} <a href="{{url}}" style="background-color: red;”>{{actionDisplayName}}</a> {{/REJECT}} {{/actionsMap}}
Note:
In Mustache, by default all variables escape in HTML. If you want to render unescaped HTML in an email's subject (that is, with special characters) you need to use triple mustache, for example{{{title}}}
, or use &, for example{{&title}}
. -
-
Click Preview to view your template before finalizing it.
Description of the illustration preview.pngNote:
In preview mode, the payload and action map sections don’t show the data.
The actual email looks something like this: