Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

...

Tip
titleConditional 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. 

...

  • 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. 

...

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.  

...