Lightning Emails

There are two forms of Lightning Emails, singe emails and List Emails. 

I haven't played much with Single Emails but I needed to really understand List Emails due to their updates in Winter '18. 

Lightning Email Templates

More to come on this topic. 

Let's face it; Lightning Email Templates are not Visualforce Email Templates. They are now mostly useable except if you are emailing Campaign Members, and except if you need related record content like you can do in Visualforce Emails.

Look, you can NOT use Lightning Email Templates in any form of Automated Emails (unless maybe you use a Flow Component from UnofficalSF, but I have not tried that). 

Many of the excellent things you can do in Visualforce Email Templates you can't do in Lightning Email Templates. 


Conditional Fields

UNDOCUMENTED FEATURE - USE AT YOUR OWN RISK! 

Who knew you could use Conditional Merge Fields in Lightning Email Templates? No? Me neither, but it seems you can. I came across it in a Pardot help document (because of course, you can't not search on Pardot content when searching H&T for Email content).

It seemed to have come out in Pardot late in 2019, but I can't see it in any release notes even for Pardot. Here is a good article explaining it's use in Pardot. 

So, here's how to use it. NOTE: It's only checking for blank, not particular values, so it's only a substitute for the BLANKVALUE format in Visualforce Email Templates. 

Simple example:

{{#if Case.Description}}{{Case.Description}},{{else}}{{Case.Subject}}{{/if}}

Paragraph Content:

{{#if Case.ContactMobile}}We will contact you on
Mobile Number {{Case.ContactMobile}}
{{else}}We will contact you on
Phone Number {{Case.ContactPhone}}
{{/if}}

Example from Josue Ramirez on Ohana Slack - using Recipient, and showing the If statement inline. 

{{#if Recipient.FirstName}}We've got good news for you, {{Recipient.FirstName}}! {{else}}We've got good news for you! {{/if}}


Oh and you can use it in Subjects too! Oh and you can use it in Lightning Email Templates built with or without the Lightning Email Builder.

More details to come after some experimentation. 

Beware, true Handlebars will not render if any form of false, undefined, null, "", 0, or [] is returned. in Salesforce false is not null, so the content will be rendered if you pass in a checkbox field. 



Lightning Email Builder

Came out in Winter '21. Not bad, but not earth-shatteringly good. More to come on this topic. 

Single Emails

More to come on this topic. 

List Emails

Oh, so close, but so far. I was going to be complimentary but wow, just wow, there is one missing feature that makes it almost useless (apart from the issues with Lightning Email Templates having NO IMAGES, but you can at least work around that). You can NOT create a List View in Lightning filtered on one Campaign. 

So how the hell do you create a List View of your Campaign Members and send them an Email - it looks like you can't. Thankfully you can still view a List View that has been created in Classic that is filtered to one Campaign, so you need to go back to Classic to create and edit these specific List Views. 

I have a current and past client that went MAD for Email Templates. This client does multiple events in a month, and has 4 emails for each event. And has saved every single Email Template back 8 years. (Well most of them are gone now). I know I can build a nice Visualforce Email Template to replace ALL of them, but if they can't send them out, then that's a bit useless. If I really cut down the requirements I could build them all with say 4 HTML Email Templates, but then if you can't do a simple list view to send the Email, how will you work it. 

Now, you can use Declarative Lookup Rollup Summary to update a Last Event Registered for field, and use that to filter on your list view, but when you are doing multiple events per month, how do you know they haven't registered for a new event before the thank you email has been sent out on the last event. Not feasible. 

There is a great new feature in Salesforce Lightning for sending bulk or mass emails. You can quickly create an Email, save it as a Template, then send it to as many people as you need to (limits apply).  

Features 

  • The full text of the email is saved in the Activity list on the Contact, and the details of ALL the other recipients are also shown. This is very cool. 

    • Question: How does data storage work - is it one 2kb chunk for each Email List send or one for each recipient. 
      • Wince 0XB is the prefix for the ListEmail object, it does look like it might be only one 2kb for each Email sent - this is GOOD! 
        • There is ListEmailRecipientSource object which states "For a list email in Salesforce, represents the source of a recipient’s email" - which is the IDs of the Views that have been added to the List Email. 
    • This is SOOO much better than stupid stupid stupid Tasks that you create on sending Emails via Workflows that take up 2kb of data for each and every Email Send, just to tell you that an Email has been sent and not giving you any indication of the content. 
    • However, only the Merge fields are shown so if the content of the field has been changed since the email was sent the activity record is a bit useless. (So this does make me think there is only one record, and it is only 2kb for each Email Send). 
  • You can use Classic Email HTML Templates that have images and formatting, or new Lightning Email Templates that are very plain. 

  • You can copy and paste HTML and images into the email, but ensure the images are externally avalable.

  • You can select multiple List Views to send the emails to. 
  • You can add individual Contacts to the recipient field. 

Prerequisites 

Help Docs 

Limitations 

  • Attachments with Classic Email Templates are not shown in the Activity. 

  • The formatting may look strange if HTML is pasted into the Email.  

  • You can't have any of the grey backgrounds that the Classic Emails had – but that is probably good.  

  • The email may not send right away, but you will receive an email to let you know it has been sent.  

Suggested Usage 

  • Do not use Mass Emails in Classic anymore.  

  • Do not create new Email Templates in Classic (unless they are going to be used for a specific, repeatable purpose, and even then use Visualforce Email Templates and automate the sending).  

  • Always send a test email to yourself first to ensure it looks fine.  

  • Create the View of the Contacts to send to. Ensure that only you can see this View. 

    • There is no need to clutter everyone's list views with random views you have created, and since Lightning List Views can't be restricted to sets of users, you could be exposing this List View name to a customer or partner community. 
  • If the List View is for Contacts in one Campaign, then switch to Salesforce Classic to create or modify this List View. Again, ensure you are the only one that can see this List View.