Heeeeey lemlister! 👋
Liquid syntax is a powerful tool that allows you to create dynamic, personalized emails that adapt to your lead’s data. With logical operators, dynamic content, and spin syntax, you can elevate your cold-email game and engage leads more effectively. Let’s dive into how to use it like a pro!
Setting Up Variables
Before you start, remember: variables should never contain spaces. Use one of these formats:
camelCase: myVariable
PascalCase: MyVariable
snake_case: my_variable
kebab-case: my-variable
How Liquid Syntax Works
Liquid syntax allows you to use logical and comparison operators to dynamically modify your email content based on lead data.
1. Personalizing Greetings
You can adjust greetings based on gender:
Then, in your email step, you can add:
{% if gender == "male" %} Hello Mister, {% else %} Hello Miss, {% endif %}
or
{% if gender == "male" %} Mister, {% else %} Miss,{% endif %}
2. Dynamic Content for Job Titles
Personalize your message based on the recipient’s role:
{% if position == "founder" %} As founder, you have to learn to delegate. {% endif %}
another example
{% if job_title contains 'Manager' %} As a manager, you understand the importance of...{% else %} I wanted to reach out because... {% endif %}
💡 Tip: Ensure your variable names in the syntax match exactly with your lead list.
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 %}
3. Time Zone-Based Greetings
Liquid syntax uses server time (France timezone). To account for time differences, adjust the hours accordingly.
Syntax rendering:
Code:
{% assign ampm = "now" | date: "%P" %}{% if ampm contains "am" %}Good morning{% else %}Good afternoon{% endif %}
or
{% assign hour = "now" | date: "%H" | plus: 0 %}{% if hour >= 17 %}Write text plus for past 17:00{% else %}Write text for previous 17:00{% endif %}
For time adjustments:
Use plus to add hours for time zones ahead of France.
Use minus to subtract hours for time zones behind France.
🌀 4. Spin syntax
Spin syntax generates variations of a sentence, providing a unique message for each email:
{% 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 %}
Each email will include a randomly selected variation, adding variety to your campaigns.
🗓 5. Get the day of sending
To include the sending day in your email, use the "date" filter.
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 need the date in another language, use a "case" statement to specify translations.
Formatting Best Practices
Important: Liquid syntax is sensitive to formatting. Avoid skipping lines or indenting within syntax. Keep everything on one line to ensure proper rendering.
Correct:
{% if variable != blank %} {{ variable }} {% endif %}
Incorrect:
makefileCopy code{% if variable != blank %} {{ variable }} {% endif %}
Pro Tips for Success
Always verify brackets are properly opened and closed.
Ensure variables in your syntax match those in your lead list exactly.
Use the preview panel to check how your syntax renders before sending.
Example Email Template
Template:
{% if gender == "male" %} Dear Mr. {{ lastName }}, {% else %} Dear Ms. {{ lastName }}, {% endif %} {% spin %} {% variation %} I’d love to connect. {% variation %} Let’s explore new opportunities together. {% endspin %} Best, {{ sender.name }}
Need Help?
If you have questions or run into issues, our support team is here to help. Reach out via chat anytime! 😊
Happy emailing! ❤️