Liquid Merge Tags

Sending personalized emails to your subscribers allows you to add a personal touch to your automated messages.

Encharge uses Liquid, a dynamic templating language built by Shopify. Liquid allows you to insert personalization in your emails, display dynamic content, and use data from people in your account in automation flows.

Personalizing with people's data

To dynamically insert data into emails or flow steps, you can use the person object. For example, to dynamically insert the subscriber's first name in an email, you can use the following code: {{ person.firstName }} .

Personalization also works with custom fields. You can review all the fields in your account in Fields Management. To personalize with a custom field, use the field's "API Name" from Fields Management, like so {{person.field-api-name-here}}.

For example, the API Name for the "Last Name" field is lastName and the personalization tag would be {{person.lastName}}.

Insert the current date and time

You can insert the current date, formatted as simplified extended ISO 8601 format (e.g. 2020-12-30T19:35:54.019Z ) with the {% now %} Liquid tag.

This will generate the current date and time in the UTC timezone. If you want to add days/hours to that time you can use this trick.

Increase or decrease a number value

To increase the value of a number field use {{person.numberFieldName | plus: 1}} where "numberFieldName" is the name of the field and "1" is the number you'd like to add to the field's value.

To decrease it use {{person.numberFieldName | minus: 1}}.

Note that you can also use negative numbers.

Creating If/Else content 

A common practice is to personalize just a small part of your email content or even specific words. For that, you need to use Liquid's Control Flow.

Here's an example:

{% if person.subscription == "free-trial" %}

Upgrade your Encharge account today.

{% elsif person.subscription == "active" %}<br>

Create a Flow in Encharge.

{% else %}

Do you need help?

{% endif %}

This is what happens in the example above:

person.subscription is the attribute (i.e., merge tag) that we use to personalize the message.

  1. If a person's subscription is "free-trial" they will see this text: "Upgrade your Encharge account today."
  2. If a person's subscription is "active" they will see this text: "Create a Flow in Encharge."
  3. With any other values, i.e. when the person's subscription is neither "free-trial" nor "active", they will see: "Do you need help?"

Note that you might need to remove the extra spacing between lines. We've included them in the example above for easier readability.

Personalizing based on tags in Encharge

You can also create If/Else content based on whether a person has or doesn't have one or more tags in Encharge.

You can do this using the following liquid code:

{% if person.tags contains “customer” %}Happy to have you as a customer.{% endif %}

If the person has the tag customer, the following line will show to them "Happy to have you as a customer."

Replacing values

In some cases, you might want to replace a specific text value. Let's say you have a text number that is populated with a + sign (e.g., +123 123 123) but you want to only populate the numbers without the plus sign (e.g., 123 123 123).

To do that, you have to remove the plus sign with this code:

{{person.FieldName | replace:“+”,“”}}

Where the plus sign is replaced with nothing, i.e., it's removed.

To replace the plus sign with a different value, for example the country code +44, you'd use the following code:

{{person.FieldName | replace:“+”,“+44”}}

Advanced personalization

Encharge supports all Liquid tags and filters as described in the official Liquid docs.

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