Handlebars Merge Language (HML)

What is HML (Handlebars Merge Language) in Pardot?

HML is used for personalizing Pardot marketing assets such as Pardot email, dynamic content, landing pages, forms and signature (based in Pardot excluding the current roll-out from our email banner signatures). It also brings additional capabilities to create simple conditional logic statements in your Pardot content (more on this below!).

How can you use HML in Pardot?

Example: Currently, you can merge Prospect and Prospect Account data using Pardot Variable tags, that look like example figure 01. After the upgrade, you will use the handlebars merge language as example figure 02.

HML fields use two curly braces {{ to render HTML-escaped data. For example: %%first_name%% to {{Recipient.FirstName}}. The updated ‘merge picker’ is launched using the ‘merge field’ button.

Bonus features include a search box and categories for easier browsing and navigation.

If you notice special characters being stripped from prospect data, add a third bracket to your merge field to use the raw modifier. For example, if a company name includes an ampersand and you see it replaced with “&”, make the merge field {{{Recipient.Company}}}.

HML’s conditional logic statements

Customers are much more likely to engage with us when our messaging is personalised and with HML enabled we can use information from the prospect record to personalise our content. However, if a prospect record does not have a value for a particular field we have placed in the email, then nothing will be displayed. To avoid empty fields displaying, we can either define a default value or we can create a conditional logic statement.

To create a conditional logic statement, you must format the merge fields like this: {{#if field.name}} {{else}} {{/if}}

Example of a conditional logic statement in an email:

Say we want to send our prospects an email with a greeting and their first name e.g. ‘We’ve got good news for you, Chandni!

But if we don’t know their first name, the HML variable tag could lead our prospects to receive this: ‘We’ve got good news for you, !

To prevent this poor punctuation and grammar, we’d create a conditional logic statement in our email, for example:

HML can be applied on Pardot Landing Page:

What are the Benefits of using HML?

  • HML’s new and improved merge field picker makes it easier to find what you are looking for. Use the search box or browse and navigate by category.
  • Salesforce is already using them! This, of course, means better and simpler workflows once you switch over from PML to HML.
  • The ability to render default content when a prospect record doesn’t contain a certain value. We can now use HML’s simple conditional logic statements in emails, email templates and landing pages.
  • An overall stronger platform than the old PML. This means that we can expect to see bigger and greater personalization features in the future

Important considerations:

  • Emails and email templates can have up to 200 HML merge fields and 10 pieces of dynamic content.
  • In order to align with merge field availability in Salesforce, these variable tags don’t have HML equivalents:

%%user_url%%

%%crm_id%% (crm_id will be replaced by contact_id)

  • If a prospect’s record doesn’t have a value for a field, nothing is displayed. To avoid empty fields, define default values for fields, or use HML’s conditional logic statements to create alternative content.
  • You can't use custom fields that record and display multiple responses as HML merge fields. Those fields also don’t appear in the merge field picker when you build content.
  • To use merge fields in email subject lines, use the Advanced Subject Composer in your email draft.
  • When a prospect clicks the view online link in an email, the merge fields populate with the values that are on the prospect's record at that moment.


How did we do?


MarTech Academy (opens in a new tab)

Powered by HelpDocs (opens in a new tab)