Skip to main content

Mastering the new customization language

To achieve your simple and complex customization use cases, you can and should use the new customization language made available in your interface. This language has been abstracted for the majority of simple or recurring use cases.

This new personalization language is based on an open-source language developed by Shopify , Liquid . Designed to be simple and easy to use , it allows users to dynamically personalize their emails and other content, without the need for advanced programming skills.

This new language offers variables, conditions, loops and other functions to customize your content. You can format text or apply mathematical calculations.

One of its main strengths is its simplicity . Beginners can easily learn the basics of the language in a short time, while advanced users can leverage its flexibility to address sophisticated and highly dynamic customization use cases. Moreover, it is integrated with many popular platforms , making it a popular choice among integrators.

-

Simple example

You can insert a variable using the syntax {{contact.firstname}} or condition part of your email based on the contact's language like this {% if contact.language == "FR"%} Bonjour {%else%} Hello {% endif %}

-

Examples of use cases

Corresponding variables with the new Liquid language

Scope contact

To add the firstname variable (formerly $firstname$ )

{{contact.firstname}}

Scope contact

To add the unsubscribe link variable (formerly $unsub_url$ )

{{unsubscription_form_url}}

Scope contact

To display a variable based on language (formerly with
{% SPLIO IF language == "EN" %} Hi {% SPLIO ENDIF %} )

{% if contact.language == "EN" %} Hi {% else %} Hello {% endif %}

Scope contact & product
To create a product loop based on a field in the contacts table.

{% create_products_list list_of_products = contact.custom_fields['custom_field_name'] %}

{% for product in list_of_products %}

{{ product.name }}

{% endfor %}

Scope command
To highlight each product of an order with conditional blocks and custom fields at the order line (= order detail)

{% for orderline in order.orderlines %}

{% if orderline.custom_fields['custom_field_name'] == 'toto' %}

{{ orderline.product.name }}

{% endif %}

{% endfor %}

Product scope

To display products based on certain product IDs

{% create_products_list list_of_products = ['product_id_1','product_id_2'] %}

{% for product in list_of_products %}

{{ product.name }}

{% endfor %}

Scope contact

With an example mixing condition and custom field

{% if contact.custom_fields['gender'] == 'M' %}
Hello mister
{% elif contact.custom_fields['gender'] == 'F' %}
Hello miss

{% else %}
Hello

{% endif %}

Scope command
To iterate over a receipt {{order.external_id}} and display, for each receipt line, the quantity and name of the product

{% for orderline in order.orderlines %}
{{orderline.quantity}} x {{orderline.product.name}}
{% endfor %}

Product scope

To display products whose list is in a custom field of the wishlist contact

{% create_products_list list_of_products = contact.custom_fields['wishlist'] %}
{% for product in list_of_product %}
{{product.name}}
{% endfor %}

Product scope

To display products online

{% tablerow orderline in order.orderlines cols:2 %} <div style="text-align:center"><img src="{{orderline.product.img_url}}" style="border-radius: 8px; height: auto; max-width: 100px" \></div> <div style="font-family:Arial,Helvetica Neue,Helvetica,sans-serif;font-size:14px;font-weight:400;letter-spacing:0;text-align:center;"> <p> {{orderline.product.name}} </p> </div> {% endtablerow %}