Email templates

Email templates provide convenient way to generate title, body, and attachments for template-based emails manually from within Platform (for a single record or a group of records). Email templates can be used in/with:

Note: Only users with access to the Templates menu can manage mail and other templates. See The Private attribute.

Template marked as Private have important limitations:

  • They cannot be used in triggers and workflow actions (since these components are shared by all users).
  • They cannot be published as part of an application.
  • Once set, a Private flag can only be modified by a user with the Administrative role.

The following example shows an email template that uses merge tokens:

When configuring email triggers, email actions, or sending a group of emails, you can use template syntax to choose the recipients for the To, CC, and BCC lines. Select an available field of type Email Address from Use Field drop-down list. That will append the selected token to the Send To text box. You can re-arrange tokens or move them to another text box. Use space " ", as separator between tokens.

The Email Addresses template only supports tokens for Email Address fields. Other tokens will be ignored.

A single email will be sent and received by all email addresses specified in the Send To, CC or BCC box. If you wish to send individual email messages - do not specify multiple email addresses.

Creating an email template

To create an email template:

  1. Open the object definition for the type of record the emails will be associated with (See Viewing and editing an Object Definition).
  2. Navigate to the Templates section.
  3. Click New Mail Template.
  4. Provide a display name for the template.
  5. Check the Private box if you want this template to be hidden from other users (checked by default for non-admin users).
  6. Select a template Format: plain text or HTML.
  7. Optionally, enter an Integration Code (used by API to find this template).
  8. Specify a Subject line for this template. The subject may include any tokens.
  9. Specify the body for this template. The body may include any template merge field tokens and loops.
  10. Click Save.

System Email Templates

Platform is bundled with two default email templates under the SETTINGS object. These templates are used send emails regarding the background job completion or failure respectively. However, these templates can be customized by the application developer as preferred.

To view or edit the system email templates, do the following:

  • From Setup Home > Administration Setup > Settings > Templates, define the mail templates of the settings object.

  • By default, two system templates are available - Background Job Completed & Background Job Failed. The adminstrator is free to customize these templates.

  • From the Job History template helper, utilise the token available to customise the template. For more information on these tokens, see Advanced Tokens.

Note: As these mail templates are system properties, it cannot be deleted.