Insert Template Tags and Variables into Text Blocks

read

Overview

When creating email templates, there are a few different ways you can customize content for each recipient. You can include things like first name, custom properties, and more.

In our template editor, we support the ability to search for a specific template tag or property variable without having to reference an external doc to find the right syntax.

2017-09-14_17-07-48.png

Dynamic Template Tags

Klaviyo currently supports auto-populating the following three template tags into a text block:

  • Unsubscribe
  • Manage Preferences
  • Webview

To insert one of these tags:

  1. Click on Insert Tag
  2. Select the tag you want to insert

Unsubscribe

Klaviyo requires that all campaigns include an unsubscribe link. To include an unsubscribe link, you can simply select Insert Tag and then choose Unsubscribe from the drop-down menu.

The tag that populates will look like this: {% unsubscribe %}

When the tag renders in an email, it will populate the following hyperlinked text: Unsubscribe.

When a recipient clicks the unsubscribe link, they're taken to a page to confirm their unsubscribe request. You can see everyone who has unsubscribed in the Profiles section of Klaviyo.

Manage Preferences

For standard lists, you can create a preferences page and customize it to match your brand. This allows recipients to update their preferences and lets you collect more information about your subscribers. To include a link to this page for each recipient, you can simply select Insert Tag and choose Manage Preferences from the drop-down menu.

The tag that populates will look like this: {% manage_preferences %}

When the tag renders in an email, it will populate the following hyperlinked text: Manage Preferences.

Learn more

Learn more about preferences pages in Klaviyo and how to segment your sending based on preferences.

Webview

To give recipients a link to a web page that shows your campaign, you can use the web view tag.

The tag that populates will look like this: {% web_view %}

When the tag renders in an email, it will populate the following hyperlinked text: View in Your Browser.

Dynamic Property Variables

Property variables refer to "people" properties that might exist on a Klaviyo profile (like "First Name," "Last Name," "Email Address," etc.). A people property could also be a custom property you created for a specific person or group of people.

Using the Insert Property dropdown, every people property that exists in your account will be available to insert into your template. Because you may have a large number of people properties, we've included a search bar so you can easily find the one you are looking for. Note that the search only works "left to right," so it will only display results that begin with the letters you enter into the search bar.

To insert a dynamic property:

  1. Click on Insert Property
  2. Select the property you want to insert

The variable placeholder inserted into your template will reflect the specific property you've chosen to insert.

You will notice that Klaviyo attaches a "default" filter at the end of each variable -- this is because you will want to set a default value that will show to a recipient if the relevant property information isn't stored on his/her Klaviyo profile. For example, if you include a First Name property, but the First Name isn't stored in Klaviyo for a given recipient, you may want to show something generic instead ("Hi there!" instead of "Hi  !").

If you don't include a default value and we don't have data to populate into the placeholder for a given recipient, the variable will just appear like a blank space.

Default Filter Example: First Name

Here you will see the default filter added to the end of a First Name property variable. We've added the word "there" as the default value.

 2017-09-14_17-19-34.png

When we know the first name of the person we're sending to, our email will feature the recipient's first name -- for example, "Hi John." If we don't know the first name of the person we're sending to, our email will feature "Hi there" instead.

Was this article helpful?
3 out of 3 found this helpful