Merge Tags

Merge tags allows users to dynamically add content to their email. Merge tags can be inserted into a block of text by clicking on the "Personalize" button in the text editor toolbar. The button is not shown if no merge tags were passed when initializing Unlayer.

We support all types of merge tags. Whether you use curly brackets {{ ... }} or square brackets [ ... ] or any other.

This is how it looks if you have merge tags...

Merge Tags


Passing Merge Tags

There are 2 ways you can pass your merge tags to Unlayer.

Option 1) You can pass merge tags during initialization like this:

unlayer.init({
  //.. init config goes here ..,
  mergeTags: [
    {name: "First Name", value: "{{first_name}}"},
    {name: "Last Name", value: "{{last_name}}"}
  ]
});

Option 2) You can pass merge tags after initialization like this:

unlayer.setMergeTags([
  {name: "First Name", value: "{{first_name}}"},
  {name: "Last Name", value: "{{last_name}}"}
]);