Skip to main content

Basic email personalization with Liquid + FAQs

How to use Liquid code to personalize emails with your subscribers' first names (and more!), plus frequently asked questions.

Updated over 2 weeks ago

This is part 1 of a two-part series about personalizing emails with Liquid:

  1. Basic email personalization with Liquid + FAQs —📍You are here


Personalize emails with your subscribers' first names and more.

Liquid is a template language available for use in your Kit emails. It lets you add dynamic content to your emails, such as a greeting personalized with the subscriber's first name.

Adding names and email addresses

You can add a subscriber’s first name and email address by pasting these shortcodes into your emails:

  • {{ subscriber.first_name }}

  • {{ subscriber.email_address }}

But that’s not all.

Adding custom fields

You can also automatically inject the content of any of your subscribers’ custom fields. Generating the shortcode is simple: use the same format as for the first name and email shortcodes above, but use the name of your custom field instead, and replace any spaces with underscores.

For example:

  • A custom field called "Last Name" would become {{ subscriber.last_name }}

  • A custom field called "Photography Experience" would become {{ subscriber.photography_experience }}

Adding a Creator Network referrer

If you're sending emails to subscribers you've received via the Creator Network, use this Liquid tag to mention the name of the creator who had referred the subscriber to you!

  • {{ subscriber.recommendations.referrer.name }}

Things to note

  • In preview emails, field shortcodes will show up as [FIRST NAME GOES HERE], [EMAIL ADDRESS GOES HERE], etc. This means you've added the shortcodes correctly—these text placeholders will be replaced with the actual values once the email is sent.

  • For custom field shortcodes to work, your custom field's name must contain only Latin letters, underscores, hyphens, and/or numbers. They must also start with a Latin letter or underscore.

To make the process of adding shortcodes easier, commonly used personalization shortcodes are available in the email editor.

Click the personalization setting (represented by the @ symbol) from the toolbar at the top of the email editor. Then, select any of the options from the personalization dropdown menu to add the associated shortcode to your email:

Alternatively, add the Personalization content block by clicking the + icon to the left of your email or by typing "/personalization."

NOTE: Curious about the "Subscriber tags conditional" option for displaying conditional content? We go over it in our advanced Liquid guide.

Fallback option

If you use a shortcode but there’s no value available for that shortcode for a subscriber, the shortcode won’t render anything.

For example, instead of displaying "Hello [subscriber's first name]," your email will display "Hello ," instead, with an unnecessary whitespace before the comma.

This is where the fallback option comes in handy. You can use Liquid’s default filter to set your shortcode to render different content in place of a value if that value isn’t available. Combining it with the strip filter also avoids any extra whitespace.

Here’s an example of how to use the fallback option for first names:

Hello {{ subscriber.first_name | strip | default: "there" }},

The shortcode is basically saying to:

  • Use the subscriber.first_name value if it’s available

  • But if it’s not, use the default value instead.

So, if your account has stored a first name value for the subscriber, the shortcode will render as “Hello [their name],”. Whereas if your account hasn't stored a first name value, the shortcode will render as “Hello there,” instead.

The word "there" is the fallback content, but you can modify this to whatever you’d like. For example, to show “Hello friend,” as the fallback instead, the shortcode would be:

Hello {{ subscriber.first_name | strip | default: "friend" }},

☝️ NOTE: Filters (meaning anything that comes after a pipe character, which is this vertical line: | ) are not currently supported in subject lines.

Previewing personalized content

When working with personalized content, you’ll likely want to check what that content will render as in the final email. This is possible via our Preview as subscriber feature.

Click the Preview option on the email editor for your email:

NOTE: If you're creating a Broadcast, you'll also find a Preview button at the bottom left of your draft Broadcast's Publish page.

After that, click the Preview as subscriber button to double-check how your personalization code will render for a specific subscriber.

Simply start typing any subscriber’s email address in the box, and the drop-down menu will populate with options for you to select from. (If not, refresh your page and try again.)

Once you click one of them, the content in the preview pane will automatically update to show exactly how it’ll look in that particular subscriber’s inbox.

Here’s a demo (notice how the content auto-updates):

FAQs

Where in Kit can Liquid code be used?

You can use Liquid in these places in Kit:

The only exception is that Liquid filters such as default (i.e., fallback code), truncatewords, capitalize, and strip are currently not supported in subject lines.

Why am I seeing [FIRST NAME GOES HERE] in my preview emails?

Email personalization won't work in preview emails. It'll work in only the actual (i.e., non-preview) email when you send the email.

But if your personalized content changes from the Liquid code you see in the email editor to a [SOMETHING GOES HERE] declaration in the preview email, this means you’ve added the code correctly.

☝️ TIP: Check out the "Previewing personalized content" section above for a great way of testing your personalized content before it goes out. Alternatively, if you're writing a Broadcast, you can send it to just yourself first as a test!

How do I fix syntax or merge tag errors?

Most often, these errors are due to typos or accidentally misplaced characters. Check out our guide to troubleshooting syntax errors to resolve the most common issues we come across.

Advanced email personalization

If you're ready to take things a step further and see what else is possible with email personalization, check out our advanced Liquid guide below.

Did this answer your question?