Introduction

Merge tags let you personalize what each contact sees: their name, their data, and whole blocks of content that change from one recipient to the next. This article covers the syntax and points you at the right group of helpers for the kind of data you are working with.

Before you begin

  • Every audience holds a mix of standard and custom fields, and any of them can be merged into an email, form, or survey.
  • The editor language lets you merge contact data, and also decide which content is shown based on that data.
  • Our editors write the merge and logic syntax for you for all but a few helpers, so you do not need to learn it. Learning it anyway gives you a lot more control.
  • Helpers can also format your data as it merges, such as rounding a number or restyling a date.
  • Account, audience, and contact data can all be merged, not just contact fields.
  • You refer to a value with dot notation. The contact's first name is Contact.FirstName.

General syntax

To merge contact data, add {{Contact.FieldName}} and the Tarvent engine fills in the value. There is also a triple brace form, {{{Contact.FieldName}}}. Use the triple braces whenever the value itself contains HTML or a link URL, because the double brace form escapes those characters and the markup would show as text.

Here is how the syntax looks in a simple template:

<html>
  <head>
    <title>Newsletter</title>
  </head>
  <body>
    Dear {{Contact.FirstName}},<br>
    This month's newsletter&hellip;
  </body>
</html>

Note: Helper names are not case sensitive, so ifEq and ifeq name the same helper. The {{else}} in a conditional helper is case sensitive and must be lower case.
Note: Straight quotes only. If you type a value in a word processor and paste it in, you may end up with curly quotes, which the engine does not recognize as quotes at all.

Culture

Some helpers take a culture, almost always as an optional last parameter. It controls how the value is formatted as it merges, such as whether a decimal is written with a point or a comma. When you do not supply one, your account's default culture is used, which is en-US unless it has been changed.

Time zone

Some helpers take a time zone. Like culture, it controls how the value is interpreted and shown. When you do not supply one, your account's default time zone is used. For the values you can use, see the Microsoft Windows time zone list.

Helper reference

There are a lot of helpers. The quickest way to find the one you want is to start from the kind of data you are working with.

Text helpers
Reshape text before it merges: trim it, change its capitalization, make it plural.

Number helpers
Format and calculate with numeric data, including totals and rounding.

Date helpers
Format dates, and calculate with them, such as moving a date forward or working out how long ago something happened.

Comparison helpers
Decide which content each recipient sees, based on their own data.

Operator helpers
Produce a true or false result for use inside another helper.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us