All Collections
Emails
Templates
Creating templates
How to use Liquid Markup for advanced variables
How to use Liquid Markup for advanced variables

This article describes Liquid Markup and how to use it for creating advanced variables.

Updated over a week ago

Templates are available on all Mixmax plans, including the Free plan. Sequences are available on the Small Business plan and above. Check out our pricing page for more information.

There might be times when you want to send a template or a sequence to a contact you may not have a ton of information on. Liquid Markup gives you the ability to insert dynamic content into your emails based on the data you have for each recipient, allowing you to send ultra-personalized emails at scale.

If you've gotten in the habit of using variables in your sequences, you can now add fallback variables, if/else statements, and conditional variables with operators to your content. If you're not yet familiar with variables in your templates and sequences, we recommend checking out Template Variables for a crash course.


Fallback Variables

Fallback variables are really simple and allow you to send high-quality, personalized emails to your entire contact list, even if you don't have the same amount of data for each recipient. All you need to do when creating a fallback variable is insert | followed by your fallback text before the closing brackets.

In your template, it would look like this: {{Company | your office}} . If you are sending the template to a contact but don't know where they work, we've got you covered and will insert 'your office' instead. When you do have the variable data, we'll treat fallbacks just like any variable you're used to and insert the data you have.

In the example below, you'll notice the first name gets properly inserted in the subject line while the Company variable uses the fallback text.


If/Else statements

You can use If/Else statements to really customize your messaging based on the data you have. When you use an if variable, we'll only insert the statement if we have data for the specific variable name. Here's how you can create an if/else statement within a template or a sequence.

  1. Open the if statement by typing {% if VariableName %} , where you replace VariableName with the specific variable you're concerned with. For example {% if First Name %} .

  2. After the opener, type the text you would like to apply if you have data for the specific variable.

  3. Now add the else variable {% else %} .

  4. Type the text you would like to apply if you do not have data for the specific variable.

  5. Close the statement by typing {% endif %} .

When you're finished, your statement will look something like this:

{% if Company %} I'd love to hear more about the culture at {{Company}} {% else %} Where are you working these days? {% endif %}

If/else statements

In the example above, everything between the opening variable and else will be inserted when the Company variable is known for your recipient. If the Company variable is unknown, the statement after else will be added instead, as you see in the gif.


Conditional Variables with Operators

Conditional variables with operators take Liquid Markup to the next level by allowing you to customize your content based on the values of your different variables. For example, you can include a specific line of text if your recipient is a manager and send all other roles a different line of text.

Currently supported operators include:

Operator

Definition

== or =

equals

!=

does not equal

>

greater than

<

less than

>=

greater than or equal to

<=

less than or equal to

Using conditional variables with operators is very similar to standard if/else statements. The primary difference is now you are adding an extra condition in order for the variable to resolve. Here's how to create a conditional variable with an if/else statement.

  1. Open the if statement by typing {% if VariableName = variable value %} , where you replace VariableName with the specific variable name and value. For example {% if Company = Mixmax %} .

  2. After the opener, type the text you would like to apply if you have a matching value for the variable.

  3. Now add the else variable {% else %} .

  4. Type the text you would like to apply if the value for the variable does not match your conditional.

  5. Close the statement by typing {% endif %} .

When you're finished, your statement will look something like this:

{% if Company = Mixmax %} Oh. Em. Gee. I love love love Mixmax!!! Thank you so much. {% else %} How are you enjoying working at {{Company}}? {% endif %}

With the greater than or less than operators, Mixmax will expect a number value in order to resolve the variable. Here's how it might look in your email:

{% if Days since last check-in > 30 %} It's been a while since we last talked! We have a lot of new features I'd love to share with your team.{% endif %}

If your condition contains both alphabetical and numerical characters, the condition should be surrounded by quotes.

Example: {% if Company = "Easy 123" %} Oh. Em. Gee. I love love love Easy 123!!! Thank you so much. {% else %} How are you enjoying working at {{Company}}? {% endif %}

Elsif operators

With both If/Else variables and Conditional variables with operators, you can start to get very granular in your messaging with the addition of the Elsif operator. You can use Elsif after any opening if variable string and before closing the if statement.

Note that the variable is elsif (not elseif).

Here's how it might look in a statement within your message:

{% if Job Title = CEO %} Our platform can help your company reach exponential growth and save you time in the process.{% elsif Job Title = Sales Manager %}We have a platform that will help your team reach their quota faster in less time. Have a few minutes to connect? {% endif %}

Just like a standard If/Else variable, you do not necessarily need a closing Else variable. When you choose to end the string without an Else variable, we will remove the variable string completely if a recipient does not match any of the conditions.

You can have multiple Elsif operators in the same variable string as well. You are not limited to just one; just make sure they are inserted before you close the string with {% endif %} .

If your condition(s) contains both alphabetical and numerical characters, the condition should be surrounded by quotes.

Example: {% if meeting = "11/12 Team Meeting" %} Thank you for joining our meeting on 11/12 {% elsif meeting = "11/12 Check-in" %} Thank you for attending the check-in {% elsif meeting = "11/13 Lunch" %} Thank you for coming to Lunch {% endif %}

Have questions about Liquid Markup? We'd love to help - get in touch with us.

Did this answer your question?