Amplemarket enables you to hyper personalize your email templates with the liquid templating language. You might run into an error when trying to send out a template due to a syntax error in the template. This article compiles the most common mistakes and how to resolve them.
Dynamic Fields
When you are using dynamic fields (example - {{first_name}}) you should:
- Always use {{ }} two curly brackets at the beginning and at the end.
- Make sure that there is no space between the curly brackets this would produce an error:
{❌{first_name}}
- Verify the syntax of the column header between the brackets. Example: {{FIRSTNAME}} would give an error and should be {{first_name}}.
Statements
Be careful with the syntax when creating "if" statements in your liquid email templates. The right framework for a statement is:
{% if CONDITION %}
{% elsif OTHER_CONDITION %}
{% else %}
{% endif %}
Syntax
In a statement, you only insert the “if” or “case” at the beginning of the statement.
✅ {% if title contains “CEO” or title contains “Founder” %}
❌ {% if title contains “CEO” or if title contains “Founder” %}
Endif / Endcase
Make sure every statement is closed.
{% if CONDITION %}
{% endif %} 👈
{% case CONDITION %}
{% endcase %} 👈
If / Elsif
In an "if" statement, make sure that only the opening statement starts with “if”. The remaining statements should contain “elsif”.
✅ | ❌ |
{% if CONDITION %} |
{% if CONDITION %} |
Hierarchy of statements - from specific to more generic
It is also important to understand the hierarchy of these statements. Amplemarket will first check if the first condition is fulfilled. If it is, Amplemarket will not check for the following options and go to the next part of the message.
Let us take a look at the example below. We would like to target a “Sales Enablement Manager”. In the example below you can see there is a specific message crafted for that title (3rd statement). However, he will receive the message included in the first statement as his title also contains “Sales”.
Amplemarket will stop searching for the conditions after it understands the first condition is fulfilled and not verify the other statements. Therefore, make sure that you order the statements from “specific” to “generic”.
✅ | ❌ |
{% if title contains “Vice President of Sales” %} |
{% if title contains “Sales” %} 👈 |
Empty “else” statement
Sometimes you might not receive an error message but an empty preview of a template. That likely means that your statement lacks an “{% else %}” statement. If none of the statements is fulfilled the “{% else %}” will serve as a fallback. If the fallback is not present, Amplemarket will not fill in anything and you will see an empty part of the email.
{% if title contains “Sales” %}
Happy to connect with people in the sales industry!
{% else %}
🤷♂️ ❌
{% endif %}
This can, however, be useful. For example, if you want to personalize your messages to some people but not for others.
{% if personalized_message %}
{{personalized_message}}
{% endif %}
The importance of case
✅ | ❌ |
Prospects location: Germany |
Prospects location: Germany |
{% case country %} |
{% case country %} |
Liquid Syntax Library
In case you have any other ideas you would like to test, feel free to consult the liquid syntax library. All the possibilities described in the library can be applied in the Amplemarket text editor as well.