top of page
  • Writer's pictureRenee Jones-Sparks

How to Create HTML Email Templates in Lightning

Updated: Dec 14, 2019

Salesforce HTML email templates are great for composing quick, well formatted, professional-looking emails to clients. You can also easily add images to your template. In this article, we’ll show you how you can create an HTML email template with letterhead in Salesforce Lightning.

And you don’t even have to go to Setup for this one!

Part 1: The Letterhead

This step is optional. If you want to create an email template that always has an image or text within the header or footer of the template, you should create an enhanced letterhead. The enhanced letterhead should be created first so that you can add it to your template. To create the enhanced letterhead:

1. Navigate to App Launcher

2. Click New

3. Add a name and description for your Letterhead

4. Upload an image by clicking the image icon on the far right

5. Click Save

Unlike Classic, Lightning lets you upload images from either your desktop or a web address. You don’t need to upload images to Salesforce to use them (4a). If you want to upload an image from a web page, make sure to include the entire URL in the address bar.

Lastly, if you want to review the HTML code behind your image, click the “Source” button in the customization bar (4b). It will display all the HTML coding information about the picture and text in the letterhead.

Part 2: The Template

The email template is where you’ll place your text and, optionally, your merge fields, the fields Salesforce will use to pull information into your template. We go into greater detail about merge fields in a separate section below.

1. From the App Launcher, go to Email Templates

2. Click New Email Template

3. Name your template

4. Select the Related Entity Type (see section below)

5. Provide a Description for your Email Template

6. Choose a private or public folder (Templates saved in a public folder can be used by anyone in the org)

7. Give the template a subject which is the email subject. Ex: Thank you for business

8a. Select the letterhead that you want to appear in the Email Template

Email Template Page - Part 1

8b. Once selected, the image will appear in the email template

9. Add email text in the text window

10. Click Save

Optional Step: Add Merge Fields to the HTML Email Template

A merge field allows you to insert custom information from the Salesforce Related Entity Type field (Object list) into an email template. The HTML merge field is a combination of the object API name and field API name.

Example: {{{Object API name.Field API name}}}


To add a merge field

  1. Place your cursor where you want the merge field to appear in the template and click the two bracket icon at the bottom of the template

  2. Select where the merge field should be pulled from. You can type the field name in the search field (a) or use the scroll bar to find the field

  3. Click Insert

About Related Entity Type

  • Related Entity Type is the list of objects from which your HTML email template can retrieve field level information to insert into the email template. This information is displayed in the merge fields you add to the template. 

  • The merge field must match the object that you are pulling information from. If the merge field is Account, Related Entity Type must be Account.

  • Selecting a Related Entity Type locks that template to that object. For example, if you relate the template to Accounts, the template will only be available for selection for emails sent from the Account object. 

  • Related Entity Type must be filled in if you want to insert merge fields into the template. 

Part 3: The End Result


Have an interesting Salesforce challenge you’d like help solving? Contact Us

Follow us on Twitter, Facebook and LinkedIn

5,398 views0 comments


bottom of page