How Do I Use Liquid Syntax? πŸ’§
Updated over a week ago

Heeeeey lemlister! πŸ‘‹

Can't wait to have your keyboard clattering brilliant cold emails? Let's unveil one of our lemlisters' secret asset: liquid syntax.

Let's go!

😲 How does it work?

The liquid syntax includes many logical and comparison operators.

For example πŸ‘‡

{% if gender == "male" %}Hello mister,{% endif %}

{% if gender == "male" %} Mister, {% else %} Miss,{% endif %}

With a Lead that has custom variable position. πŸ‘‡

{% if position == "founder" %} As founder, you have to learn to delegate. {% endif %}

You can use multiple operators in a tag. πŸ‘‡

{% if type == "freelance" or type == "smb" %} We know it's not easy as a small company {% endif %}

Another example πŸ‘‡

If we want to adapt the greetings, according to the time of sending

Syntax rendering:

Code:

{% assign now = "now" | date: "%H" %}{% if now < 12 %}Good Morning ! {% elsif now < 18 %}Good Afternoon ! {% else %}Good evening !{% endif %}

🚨 Pro tips 🚨

If the syntax does not work:

  • check if the braces are well-opened and closed.

  • make sure if you're using a variable that it does not contain any space in it ("myVariable" and not "my Variable").

  • check if the text corresponds well to the variable.

It is very simple:

{% if myVariable == "text" %} my text {% endif %}

If "myVariable" for the lead is equal to "text" it works, if you write "txt" in your liquid syntax it is not going to work, same for "my text", "texts" etc ...

βš—οΈ What can I do with it?

πŸŒ€ Spin syntax

With spin syntax, you will be able to get multiple variations of a sentence that will be picked up when the email is sent.

{% spin %} {% variation %} I really want to talk with you. {% variation %} I think we should meet. {% variation %} What if we take a coffee. {% variation %} I really like your shoes. {% endspin %}

For each email lemlist will send, it'll pick one of those variations. You can see the result in the Preview panel, each time you open it, the sentence in the preview will change.

πŸ—“ Get the day of sending

To get the day of sending, you have to use the filter "date" with the format "%A". You can find other formats here.

lemlister tip πŸ’‘ Don't forget to replace {{ }} with {# #} as a double curly bracket is already used in lemlist for custom variable syntax.

 {# "now" | date: "%A" #} 

If you want to use other formats you can take a look at the strftime page.

If you want to display the date in another language than English, you can use a "case" like this:

⚠️ Warning ⚠️

The formatting of the liquid syntax is important. If we skip lines, come back to the line ... in the middle of a syntax, this will be taken into account in the formatting of the mail. That's why we write everything on one line, without indenting the code, even though it's more complex to read

{% if icebreaker != blank %} {{ icebreaker }}{% endif %}

β‰ 

{% if icebreaker != blank %}{{ icebreaker }}{% endif %}Here is a video to do it step by step together 😊

Enjoy ❀️

Did this answer your question?