Admins

Your Guide to Salesforce Lightning Email Templates

By Paul Ginsberg

Do you like receiving plain text emails from businesses, or does this look a bit shabby? Salesforce comes to the rescue with Lightning Email Templates. Using the Lightning email builder built on the Salesforce platform, you are able to insert fields into email templates (mail merge) from a record in Salesforce to use across a range of use cases (e.g. for sales emails, renewals, and case updates).

Your users can use the Lightning Email Template Builder to merge fields into email alerts, Flow, Approval Processes, and more. It’s easier to use than Salesforce Classic Email Templates, adhering to modern email design practices. This is the same builder that’s been rolled out across other Salesforce platform products, such as Account Engagement (formerly Pardot).

In this guide, we’ll look at how to set up Lightning Email Templates (which are not enabled by default). Then we will look at the components, limitations, and scope for the future.

How to Enable Lightning Email Templates

This is a two-part process (perhaps try it in a sandbox first!).

Part 1: Enable Template Folder Sharing

This part is not mandatory, just very helpful to all your users, so they can share and access email templates amongst themselves.

1. Go to Setup and search for Lightning Email Templates.

2. Switch on Folders and Enhanced Sharing (see the screenshot below).

Part 2: Enable Content Builder

1. Create a new Permission Set (e.g. “Lightning Email” permission set).

2. Go to System Permissions.

3. Tick Access drag-and-drop content builder (this controls whether the Edit in Builder button appears later on).

4. Save.

5. Apply to users as appropriate.

6. Wait 15 minutes, or log out and back in again – this is to avoid the Lightning delay! If you don’t see the Edit in Builder button when using the Template Builder in the next section, then your system still hasn’t been updated.

Create Email Templates in Salesforce Lightning

1. Click on App Launcher (the nine dots, in the top left-hand corner) and search for Templates in the app menu. Apparently, it’s been there for a while, but this is the first time that I’ve noticed it!

2. Create a new template. Here you put in the ‘metadata’ for the email, such as the subject line, which object it relates to (if you want to merge field data into it), and where it should be saved. The body of the email will come soon, but not quite yet!

3. The next screen will have the Edit in Builder button. Click it!

4. Once in the email screen itself (which we’ll fully explore in the next section), you will probably want to update the background color as your first action item. If gray is your thing, then leave it alone. And if not, go to Style (on the right), click the color selection box, and change it to #FFFFFF or 255, 255, 255 to reset the background to white.

Add images to email templates in Salesforce Lightning easily by dragging an image component from the left-hand sidebar onto the email canvas.

5. Welcome to the Lightning Email Builder!

Lightning Email Builder Component

You’ll recognize the layout of the Content Builder. On the left-hand side are the drag-and-drop components. The exciting part is that there’s clearly scope for new elements to be added over time.

On the right-hand side, the properties/details of each component can be adjusted – such as merge fields for rich text, image location (which you can directly upload), or color, margin, and image width in the Style subsection.

Press Save, and then you’re ready to use the email template!

How Does it Work?

As discussed, you can use these in an Email Alert – or end users can use them directly within Salesforce when creating an email. At the bottom of the email screen, there’s the insert, create, or update template button, which users can click to select the template that they want.

And, with that previously mentioned (but avoidable) default gray background creeping in at the sides. Here’s the final result when received and viewed on mobile:

Lightning Email Template Limitations

  • Merge fields are resolved for most activity-enabled objects. Since the Lightning email builder’s release, Salesforce have added merge fields for Contact and Lead objects.
  • You cannot edit classic email templates in the Content Builder – you have to create a new Lightning email template. However, updating an Email Alert is simply a matter of editing the Email Alert and pointing it to a Lightning email template.
  • Cross-object merge fields still aren’t supported (though there’s a popular IdeaExchange entry that Salesforce are very much aware of).
  • Lightning Email Template Content Builder is not as powerful as Marketing Cloud’s Email Studio.
  • Some Classic Template functionality is missing, such as:
    • Send Test and Verify Merge Fields
    • Record Type Name – this field needs to be recreated as a Formula Field because using the Record Type ID field gives the ID instead.
    • Details Link (the ability to insert a link directly to the record, which is very useful for internal email alerts). The merge field you need to type is “.link” e.g. {{{Contact.link}}} or {{{CustomObject__c.link}}}

Further Reading

If you’re keen to continue learning about Salesforce Lightning Email Templates, check out the resources below:

Finally, huge thanks go to Johann Furmann and Justyna Krajewska for their input on this article.

The Author

Paul Ginsberg

Paul is a nonprofit specialist and Golden Hoodie.

Comments:

    Tom Peppers
    July 21, 2021 11:33 pm
    I am a System Admin and created a Lightning Email Template with the Template Builder. I saved the template in the Public Email Templates folder, but when I try to insert a template it does not appear in the list of available templates. I checked My Templates, All Templates, Private Email Templates, and Public Email Templates and nothing.
    Emma
    July 28, 2021 4:47 am
    I had this issue too Tom, in my case I realised it was because I had selected the 'Related Entity Type' as Opportunity, but I was trying to email from a Contact. When I went back to the template and saved 'Related Entity Type' instead as --None-- it then would appear under templates in the email on the Contact.
    Shash
    August 02, 2021 7:31 am
    Does Lightning template support emailmessage object ? For example if I need to set the subject of the template as the Value from the subject field from EmailMessage Object ? Something like this {{{EmailMessage.Subject}}} . Thanks in advance .
    Chris
    August 09, 2021 4:05 pm
    I am new to Salesforce and am learning as I go. I have created a lightning email template that is connected to email alerts. I am creating a flow that will send a schedule-triggered email every day to people whose membership to our organization will expire in 30 days. I have the custom objects created and the flow rules set up to only send to those whose membership hits the 30-day window each day. My issue is the merge fields from the template are not working in Flow. I get an error every time I have a merge field in the template, regardless if the merge is for the recipient or account. The flow does not recognize the field. Is there a way to make this work? I would like to personalize the email as much as possibe.
    Jessica Macpherson
    August 26, 2021 10:00 pm
    Hey Paul - thanks for you very helpful post. Its super useful to add this step also - "Create Folders for Lightning Email Templates" checked in Sys permissions for your user profile.
    Anet Gambina
    September 01, 2021 10:54 pm
    Excellent article. Thank you!!
    Laura
    September 14, 2021 9:45 pm
    Does this email template builder have a specific program name? Such as how Draw Loop, Lightning template builder, Mail Chimp... etc all have different identifying names. If it doesn't how are we supposed to find specific answers when looking up this template?? Also, I can see it doesn't support cross-object field merging, but what about related/child object merges? For example if I was making an estimate template in HTML body using this builder, would I be able to use both an estimate object and its related estimate line object to make an estimate line merge table? I think this is possible in Draw loop, but if I don't have the purchased software I can't use it unless I attach a document. Is there any work around without having to buy Draw Loop?
    Julia
    September 22, 2021 2:33 pm
    Thanks for putting this together. In Classic we relied heavily on enhanced letterheads. Is there an equivalent functionality in Lightning's Builder? Essentially, we need to be able to update the banner image at the top of an email en masse so that ALL email templates have the image component (or equivalent) updated at the same time rather than manually going through each template. Is this possible? When I've tried using enhanced letterheads in Lightning the "edit in builder" option isn't available.
    Amy Hermes
    September 24, 2021 8:46 pm
    I'm new to Pardot and am trying to figure out if I can update the email canvas size in the Lightning Email builder when creating templates. I have a few email templates that require a wider canvas. Thanks
    Paul Ginsberg
    October 13, 2021 7:42 pm
    The Lightning Email Template Builder is a native part of Salesforce - it is not an external add-on such as Draw Loop. Tables pulling data from child objects are not supported, although Salesforce are aware of the Communities' desire for such a function. There are other programs, but generally they all have a cost, and different benefits. AppExchange has more, and the SalesforceBen AppAssessor has also reviewed some: https://www.salesforceben.com/category/app-review/appassessor/
    Paul Ginsberg
    October 13, 2021 7:50 pm
    Not yet supported - one option would be to look on the all new/revamped IdeaExchange https://ideas.salesforce.com/ and see if there is an existing request, or post a new one. An alternative is hosting the image externally (e.g. on the company website) and pointing people to that image, which you can update whenever you want.
    Paul Ginsberg
    October 13, 2021 7:52 pm
    The idea behind the Lightning Template Builder is that the emails are responsive (to mobile/desktop/etc). If you set a specific canvas size, then that loses the responsive element. That said, you can try by hard coding the values in HTML but I don't recommend it.
    laura
    October 19, 2021 5:36 pm
    Thank you for the reply and the link, I also have a question about merge images, as I can view them in the email preview before it's sent, but the merge image is no longer visible in my gmail inbox after sending the email template. Also I have a checkbox that is showing a 1=yes and 0=no instead of YES/NO like it does in SDocs. Does anyone know how to solve these issues?
    Paul Ginsberg
    October 20, 2021 9:06 am
    You can log a ticket via Salesforce Help and they will be able you out with these specific problems. That said, just because functionality exists in SDocs, that doesn't necessarily mean it is supported by Lightning Template Builder as they are two different products, made by different companies.
    Kathleen
    November 18, 2021 6:59 pm
    I have a weird situation where I have built a number of email templates for my team to use, but they are only pulling merge fields for some teammates, not all. Is there a specific permission set that users need in order to have merge fields populate? Thanks in advance!
    Paul Ginsberg
    November 19, 2021 10:20 am
    There shouldn't be any additional permissions as far as I am aware, if the template is sending at all. Add the merge field to the page layout and log in as the user to check that they can see the field normally. If they can't, then it's a permissions thing. If they can, then it's time to log a ticket with Salesforce Support team.
    Amy
    November 23, 2021 4:34 pm
    Can we add image background in a lightning email template?
    Paul Ginsberg
    November 24, 2021 10:39 am
    You'll have to experiement, but within the builder, if you click on the main canvas (outside any specific element), on the right hand side you will see Details and Style. Click on Style and within the "Background" option there is a "Select from Files". Write back and let us know if this works for you!
    Raseema
    November 30, 2021 8:55 am
    Merge fields either not appearing or showing blank for preview email on composing the email for cases. What would be the possible reason?
    Paul Ginsberg
    November 30, 2021 9:55 am
    Typically it will be field permissions. Troubleshooting questions to help you navigate are does this work for Admin, but not other users; can you see the field on the page layout; does this work for classic email templates. You can also log a case with Salesforce support and they will be able to guide you. And here's one one place where I recommend anyone else can also ask questions (rather me answer them all here, which isn't sustainable long term!): https://trailhead.salesforce.com/trailblazer-community/groups/0F9300000001oVpCAI (it's Salesforce's Admin Trailblazers group on the Trailblazer Community)
    Tony
    December 09, 2021 10:33 am
    Anyone got an example or confirm if not possible but can you do a conditional statement? Scenario is display name if I have one but fixed text if the display name not populated
    Maninder
    December 09, 2021 11:40 am
    Hi Paul, I am facing following issues: 1. Template not visible in email content 2. When trying to create email content from the Template related tab it throws following errors: We can’t save the record. Ensure the provided email template was created using the Email Template Builder and doesn’t contain Salesforce files. I build the report in email builder. I used images by saving them in the related tab files of the template. Help Appreciated. Thanks,
    joe
    December 15, 2021 11:31 pm
    Thanks for the detailed info. I have a query.. We created templates using lightning template builder, but we are not able to access them via engage emails. We can set template availability while creating templates in classic i.e - One-to-one or List emails..... Emails created as one-to-one are available for engage emails. How do we enable this while creating templates using lightning email builder
    joe
    December 15, 2021 11:37 pm
    Hi Maninder, can check if below resolves your issues. 1. When creating the email template, you need to tie the template to a specific object, only then you can use those templates for specific objects. For example, if you specify related entity as contact while creating template in lightning builder, you can access the template to send emails on Contact 2. When creating template, use upload images to the CMS content and use those images. This should resolve the second issue
    Jenny
    January 18, 2022 7:38 am
    When inserting an email template, is it possible for a user to edit the content of an email before sending to a customer. This is showing as locked for the user?
    Paul Ginsberg
    January 18, 2022 1:48 pm
    I'm not too sure what you mean by engage emails.
    Heiko
    February 15, 2022 3:08 pm
    Very helpful article - bookmarked! I have the situation that I needed to apply changes to 75+ both Classic and Lightning Email templates. To test them I would like to send them to my email address in bulk instead of sending each template manually. How could I do this? Any tools or experiences for this?
    Alicia
    February 25, 2022 6:06 pm
    Hi Paul, Thank you for the step by step instructions on how to use the Lightning Email templates. I have followed the above steps in my org(sales cloud) but i'm still not able to see the 'Edit in builder' option. Do I need to do something different? Or is it only available in Pardot?
    Paul Ginsberg
    March 05, 2022 9:23 am
    Hi Alicia. You may need to contact Salesforce Help to figure out why this isn't available for you. You can log a case with this. All the functionality described in this article is available on the core Salesforce platform regardless of whether you have Platform, Sales or Service Cloud licenses.
    A. Miah
    March 08, 2022 5:02 pm
    Where can I edit the HTML elements for the Template Builder so the border isn't so big?
    Justin
    March 09, 2022 9:46 pm
    Hello, Excellent article, but I am stuck and need some help. The issue I am having is the "Background Image URL" - I add a file and it appears in the Email Template Builder, but when I test and receive the email - It does not display the background. It only shows the "Background Color". I have tried leaving "Background Color" blank and as described in this article and still having issues. I am fairly new so I could be missing something.
    Nate
    March 25, 2022 7:56 pm
    Thank You this is very helpful!!!
    Becky Howe
    May 17, 2022 9:50 am
    Thanks, great article! Does anyone know if there's a way to alter the button shape? Eg to round the corners
    Himanshu Yadav
    May 23, 2022 10:11 am
    Can we use conditional statement on it for Ex:- {{{Abc__c}}} == something , put this section , else this section
    Bert
    May 26, 2022 10:02 pm
    Nice Article. Im struggling right now on the feature as my Org required to create some templates for different EMEA countries. When I send email templates that contains hebrew character the email is well generated but once it gets to the user inbox all hebrew chars are replaced by question marks "?". Do you know what is the reason of this? I read that it could be related to my user email encoding but I already have it as UTF-8 and seems to not make a difference. Any suggestions?
    Carl
    May 26, 2022 10:24 pm
    Very Good Article! thanks You mention - "Merge fields are resolved for most activity-enabled objects – the exception is that merge fields are not yet available for Contact and Lead objects (this is on Salesforce’s roadmap)" Is that why i cannot get my template/email alert/workflow to work when i merge {{{Recipient.FirstName}}}? My Related Entity Type = Contact or did i do something else wrong? is this an issue that needs Salesforce fixing? if so, is there an ETA?
    Sudarshan
    June 09, 2022 3:19 pm
    I am not able to see insert email template icon for community users, is this a limitation?
    Atsanon
    September 01, 2022 12:52 pm
    Despite the article, I can't get the "Edit in Builder" to show up. (Yes, I granted myself the "Access drag-and-drop content builder" permission, if anyone asks.) I am frankly getting frustrated. I can only hope that when Salesforce says "Lightning", it means "fast", not "sudden" or "out of the blue" or "astonished".
    Kyung
    October 04, 2022 3:10 pm
    I am not sure, but you cannot open previously created lightning templates to Builder. You have to create a new template first, and then click Edit in Builder. This has confused me in the beginning too.
    Abir
    February 07, 2023 2:15 pm
    Thank you for the article, it's interesting, However I have an issue while using the email template, I created an email template, and when I try to send my email using it, sometimes the email is sent with an empty body, and sometimes it is snet correctly. I didn't understand the reason why, (i paid attention to the field emailtemplateId, when the body is empty, that field is null) .
    Ken
    April 05, 2023 12:43 pm
    Having done every step you recommended, what could be the reason why the builder is still not available for our orgm
    Roberto Leon
    May 18, 2023 6:37 pm
    How can I add an Approval Process link to the Lightning Email Template? Any help is appreciated.
    Abishek Saravanan
    June 21, 2023 9:52 am
    Hi Paul, I Created a lightning email template. I changed the background to white and Just when I test it I get my content in centre. I wanted it to be in the left side

Leave a Reply