Throughout this article you will learn everything about the email motor, which is behind the editor. It allows you to automate a lot of tasks and ensures that your dynamic emails are constructed perfectly.

The Liquid language uses variables, which are marked with {{ }}. You have likely already seen these, while creating an email with Reloadify; for example with the name of you customers: {{first_name}}.

Content of this article

  1. Which variables are available in Reloadify?

  2. How to use variables in the email editor?

  3. Adjust variables

  4. Adjust the amount of displayed products

1. Which variables are available in Reloadify?

The following variables are available in Reloadify:

Customer variables
{{first_name}}
{{email}}
{{street}}
{{housenumber}}
{{zipcode}}
{{city}}
{{province}}
{{birthdate}}
{{last_name}}
{{last_ordered_product_name}}
{{last_order_date}}
{{last_order_amount}}
{{last_order_id}}

Link variables
{{main_domain_url}}
{{unsubscribe_link}}
{{shopping_cart_url}}

Product variables
{{ product.name }}
{{ product.price }}
{{ product.short_description }}
{{ product.url }}
{{ product.brand }}

๐Ÿ’ก Tip: As soon as you have multiple products, add numbers to them. For example: {{ products.name[1] }} etc.

2. How to use variables in the email editor?

Profile- and link-variables can be added in all emails. You can either write them yourself or you can find and insert them under the option "Merge tags".

3. Adjust variables

Following this it's possible to adjust the available variables. Imagine you would like to address your customer by their first name. But there is a chance that you or the system doesn't know every single customers first name. In these cases you want to have some redundancy. Below you will find all frequently used variables.

Falling back on a word (default)

It can sometimes occur, that you don't have all the data of a profile or product, like first and/or last name of the customer, or the brand name of a product. By default we will not display anything in this case. Do you instead want to fall back on an alternative text? This is done by using a default.

For example:
Hello {{ first_name | default: You! }}

If the first name of a customer isn't available, we will display "Hello You!" instead of "Hello".

Prepend text to a variable

With the prepend function you can insert a text in case a variable isn't available or doesn't exist. Imagine you want to send a newsletter: You can make the newsletter more personal for customers who have already purchased something in your online shop. You could for example ask if they liked their most recently ordered product. In that case you would write: "We hope you're happy with your new {{last_ordered_product_name}}". The problem is that customers, who haven't bought anything yet, but are registered for the newsletter, will read an incomplete sentence. With prepend you can avoid this problem.

Example:
{{last_ordered_product_name | prepend: "We hope you're happy with your new}}

If a profile receives this email, but hasn't purchased anything yet, the system will not display any of this. But if a profile has already bought products, our system will display:

"We hope you're happy with your new Nike Air Max Shoes".

Character limit in a text (truncate)

With truncate you can limit the amount of characters. Some product titles or its description are longer than others. With truncate you can limit these.

For example:
{{ product.title | truncate: 10 }}

Here the product title will be cut off after 10 characters. By default the system displays the dots (...), at the cut-off point. You can change this to suit your requirements.

In the following example the product title is meant to truncate and be followed by an "etc.", instead of the three dots (pay attention to the space character):

{{ product.title | truncate: 10, " etc." }}

Do you want to display nothing after breaking off the text? It would look like this:

{{ product.title | truncate: 10, "" }}

In the last example, the product title will break off after 10 characters, without displaying anything after it.

Word limit in a text (truncatewords)

Truncatewords works exactly like truncate, but instead of counting the characters, you can determine the amount of words.

{{ product.title | truncatewords: 5 }}

In the example above, the product title will cut off after five words. Here you can also decide, how the break should look like. Once again by default the system will display three dots (...) behind the last word or it can be adjusted.

4. Adjust the amount of displayed products

You can find dynamic products in the menu on the right under "Rows". There you'll find the option with and without "all".

Using the option with "all", the dynamic block works like a "liquid loop". Use for example "all last ordered products". The block repeats itself as often as the amount of products in the last order of the customer. In the option without "all", there will be no loop.

To stick with the example of "all last ordered products": If customer A ordered 2 products, customer A will see those two products. If customer B ordered 5 products, our system will display all five products in the email.

Because we're working with a liquid loop, you can also adjust it. Just drag the row into the email editor, click on the row and select "edit criteria". In the following image you can see all criteria.๐Ÿ‘‡๐Ÿผ

Defining the amount of products in a loop (limit)

With the limit function you are able to limit the amount of products in a loop. Use this for example if you want to display all last ordered products, but you don't want to display all 20 products a customer bought. Select the row, which you dragged into the email, click on the right in the menu on "Edit criteria" and add "Limit X", whereby X is the maximal amount of products. Have a look at this example๐Ÿ‘‡๐Ÿผ

For example:
{% for product in last_ordered_products_collection_array limit: 3 %}

In this case, our system will display maximal 3 products in the email.

Easy right? Have fun!

Did this answer your question?