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:
- Email Template fields, see Email Template Field.
- Send Email workflow actions, see Workflow actions
- Workflow triggers, see Trigger overview
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:
- Open the object definition for the type of record the emails will be associated with (See Viewing and editing an Object Definition).
- Navigate to the Templates section.
- Click New Mail Template.
- Provide a display name for the template.
- Check the Private box if you want this template to be hidden from other users (checked by default for non-admin users).
- Select a template Format: plain text or HTML.
- Optionally, enter an Integration Code (used by API to find this template).
- Specify a Subject line for this template. The subject may include any tokens.
- Specify the body for this template. The body may include any template merge field tokens and loops.
- 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.