Workflow Templates

From LongJump Support Wiki

When you automate a business process in a Workflow, you have the option to send email notifications based on state changes in the workflow.

The Templates option allows you to create personalized email messages that are sent automatically from the workflow. For example, a request is submitted for review, so an email notification is automatically sent to the requester.

If no templates are added to the workflow, the system default templates are used.

Each workflow can only have one Notification Template and one Global Workflow Template. A State-Specific Workflow Template can be used to override the Global Workflow Template for a specific state. Replies to the emails can also be used to trigger actions.

Create or Edit a Workflow Template

  1. Click Designer > Objects > {object}
  2. Click the Workflows tab
  3. Choose a workflow.
  4. Click the Notification Templates link.
  5. Choose an existing Template, or click the [New Template] button to add a new template
  6. Choose one of the following Template Types, then click [Next]:
    Notification Template
    Used to inform all record owners and additional users (specified in an action) of the state change
    Global Workflow Template
    Used to inform the workflow owners that an action from them is required
    State-Specific Workflow Template
    Used to inform the workflow owners that an action from them is required for a specific state (overrides Global Workflow Template)
  7. Compose the message template, completing the fields below.
    Template Information
    Template Type - Entered by default, based on your choice
    Template Title - Title of the template
    Description - Enter a description of the template
    Email Information
    Information in this section is used when Send Email is selected for a state:
    Subject - Enter a subject for the message
    Editor Type - Choose from HTML, Plain Text or WYSIWYG Editor
    Details - Provide the body of the message.
    Relay Feed Information
    Information in this section is used when Post a Feed is selected for a state:
    Feed Message - Enter the message to post
    Relay Feed Template - Enter the message to post
  8. Use the Template Variables to customize the message.
  9. Click [Save]

Template Variables in Workflows

Template variables can be used in both subject and body of a template. All the template variables related to the record are shown.

The Template Variables section provides a lookup to variables that will personalize the message.

In addition to the typical field-based template variables, these workflow-based variables are also available:

  • $workflow.id
  • $workflow.name
  • $workflow.title
  • $workflow.current_state - Name of current state
  • $workflow.previous_state - Name of previous state
  • $workflow.action_taken - Name of Action Taken
  • $workflow.available_actions_for_current_state - Names of available actions in current state
  • $workflow.current_state_title - Title (label) of current state
  • $workflow.previous_state_title - Title (label) of previous state
  • $workflow.action_title_taken - Title (label) of action taken
  • $workflow.available_action_titles_for_current_state - Titles (labels) of available actions in current state
  • $workflow.user_comments
  • $workflow.owner - Current record owner(s)
  • $workflow.history - History of workflow (a table)
  • $workflow.view_details_link - Link to view record details

Default Sample Templates

When you add a template, these sample templates are available for your use. Start with these samples, and customize your message to meet your needs.

Sample Notification Template

Subject: $record.name Workflow Has Been Updated
Hello,

The record $record.name has changed from 
    '$workflow.previous_state' state to the
    '$workflow.current_state' state.

Comments provided by previous workflow owner:
$workflow.user_comments

Current workflow owner(s): $workflow.owner.

Current workflow history:
$workflow.history

To view record details, click here:
$workflow.view_details_link


This is an automatically generated message. Please do not reply.

Sample Global State Template

Subject: Action required for $record.name
Dear $workflow.owner,

You are required to take action on the record $record.name

Comments provided by previous workflow owner:
$workflow.user_comments

To take action on this record, you can reply to this email 
directly with one of the following commands:
$workflow.available_actions_for_current_state

(Please keep the action as the first line and any 
comments within the second line)

Current workflow history:
$workflow.history

To view record details, click here:
$workflow.view_details_link

This is an automatically generated message. Any replies 
that do not have the proper actions will result in an error.