I am working with an HTML template that includes <message:emailTemplate> and <messaging:HTMLEmailBody>. We are currently using Lighting experiences so the error is saying

This template does not support SML merge fields. Use the merge field picker to replace merge fields with with "{!"

Since I am using Lightning experiences, I know SML is not supported. How can I turn this into HML so that I can use this template?

Here the full error I am getting.

enter image description here


It looks like you started with a Visualforce template given that messaging:HTMLEmailBody is a Visualforce tag that isn't supported in this context (it wouldn't be found in an HTML classic template).

Both SML and HML may be used depending on when the template was created. HML (Handlebars Merge Language) is the newer syntax so you need to replace your old SML (Salesforce Merge Language) syntax with HML. You can use the merge field picker (like it recommends) or you can identify merge fields that currently look like {!Entity.Some_Field__c} and convert them to {{{Entity.Some_Field__c}}}. Just bear in mind there may be some additional limitations with the HML syntax that not all of these fields will be 1 to 1 (such as relationships).

  • Awesome, thanks a lot for the help. Will I need a version for users who have classic vs lighting? Or can I use handlebars in both lightning and classic? – user93645 Mar 4 at 21:03
  • I have zero experience with Lightning templates, but I imagine since these are emails it doesn't matter what version a user is using. You cannot use HML syntax in a classic template. – nbrown Mar 4 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.