How to insert template tags and variables into text blocks (classic editor)

read
Last updated at:

You will learn

Learn how to customize content for each recipient in your emails by including things like first name, custom properties, and more.

Are you using Klaviyo’s new template editor? Head to our new editor resource center.

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

The insert tag and insert property menus in Klaviyo's template editor

Dynamic template tags

Klaviyo currently supports autopopulating 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:

  1. Select Insert Tag
  2. Choose Unsubscribe from the dropdown 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.

An unsusbcribe link in a Klaviyo email

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:

  1. Select Insert Tag 
  2. Choose Manage Preferences from the dropdown 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.

A manage preference link in a Klaviyo email

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.

A view in browser link in a Klaviyo email

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, you can use the search bar so to find the property 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.

 A first name template variable in a Klaviyo template

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.

Learn more about using filters to customize your variables

Additional resources

x
Was this article helpful?
108 out of 214 found this helpful