Handlebars - Overview

Table of Contents

Handlebars is a templating language that allows for dynamic email template personalization, ranging from simple use cases (Company Names, Email Addresses) to more complex scenarios (Nesting Helpers, Conditional Content). 

Handlebars work whether you are using the DND Builder, the Basic Editor, or uploading your own HTML code. They can be typed directly into the body of your email campaigns or added right into the HTML code.  

For example, if your Contact Database featured a Company Name, you could have a sentence in your Email Campaign start with "As a valued customer of {{Company}}" (Fig 1).

Fig 1

When the emails get sent out, it will know to replace the "{{Company}}" text with the associated field in the Contact Database for each email that get sent out (Fig 2).

Fig 2  

Handlebars can use either Simple Variables or Complex Variables.  

Simple Variables using alphanumeric characters with optional underscore characters only need to be surrounded by two curly brackets on either side. 

Here are some Simple Variables

  • {{emailaddress}}
  • {{unsubscribelink}}
  • {{companyname}}
  • {{current_day}}
  • {{current_month}}
  • {{current_year}}

Complex Variables feature special characters other than underscores and are required to be wrapped in square brackets within the curly brackets. Complex Variables are often custom fields in your Contact Database. 

Here are some examples of Complex Variables:

  • {{[First-Name]}}
  • {{[Last-Name]}}
  • {{[Phone-Number]}}
  • {{[Loyalty-Points]}}

In more advanced scenarios, Handlebars can handle advanced dynamic tasks with different kinds of Helpers:  Comparison HelpersLogical HelpersUtility Helpers, and Nesting Helpers.

These will be covered in further detail in future articles.

The Pinpointe Playbook