How to personalize messages?

Send messages with the personal information

Personalization based on lead properties

To make messages more personal, add lead properties to the message text (such as name, city, etc.). Dashly has two types of property: system and custom. System properties are collected automatically. Check the full list of system properties.

To add system property to the message, click on the icon and enter the system property name manually.

If this property is not defined, you can substitute it with another text.

This construction will help you:

{{user [' property name '] | default ('substitute text')}}

You can collect any lead properties via API, Tracking master or add them manually right in lead card as well.

Add the following to make them appear in the text:

{{user [' property name ']}}

If this property is not defined, you can substitute it with another text as well. In this case add:

{{user [' property name '] | default ('substitute text')}}


1) Hello,  {{ user['$name'] | default('Dear customer') }} 

The value of name field will be added. If it is unknown, then it will be replaced with "Dear customer" text. Name is a system property, so it begins with $

2) Your order amount is  {{user ['cart amount']}}  dollars. Do you want to place an order?

If order amount is 100$, then lead will see the following: "Your order amount is 100 dollars. Do you want to place an order?"

Personalization based on event properties (abandoned carts)

To add viewed or added to cart items you need to set data collection. All data added to email is taken from event properties.

When data collection is configured, you will see "Item viewed" and "Added an item to the cart" events in lead cart:


If everything is configured, let's move to message creating.

1) Paste the code to the message text, so last 20 added to cart items will be shown in the message (they won't be duplicated):

Viewed items code:

{% set massViewed = [] %}
{% set massViewedName = [] %}
{% for e in get_last_events('$product_viewed') %}
{% if e.props['$name'].lower().strip() not in massViewedName %}
{% set x = massViewed.append(e) %}
{% set x = massViewedName.append(e.props['$name'].lower().strip()) %}
{% endif %}
{% endfor %}

Added items to cart code:

{% set lastDateCompleted = 0 %}
{% if get_last_events('$order_completed') | length > 0 %}
{% set lastDateCompleted = get_last_events('$order_completed')[0]['created'] %}
{% endif %}
{% set massOrder = [] %}
{% set massOrderName = [] %}
{% for e in get_last_events('$cart_added') %}
{% if e['created'] > lastDateCompleted %}
{% if e.props['$name'].lower().strip() not in massOrderName %}
{% set x = massOrder.append(e) %}
{% set x = massOrderName.append(e.props['$name'].lower().strip()) %}
{% endif %}
{% endif %}
{% endfor %}

If you compose HTML email, do not forget to include div with display style: none - in order not to show it in message.

2) Run a loop which will add data from created massive:

Viewed items code:

{% for b in massViewed %}
{% set link = b.props['$url'] %}
{% set img = b.props['$img'] %}
{% set name = b.props['$name'] %}

Added items to cart code:

{% for b in massOrder %}
{% set link = b.props['$url'] %}
{% set img = b.props['$img'] %}
{% set price = b.props['$amount'] %}
{% set name = b.props['$name'] %}

After this you need to add a block with items (you should replace link to the item, it's name, price and link to it's image with corresponding variable {{link}}, {{name}}, {{price}}, {{img}}).


<img src="{{img}}">

<a href="{{link}}">{{name}}</a>

<span>{{price}} rub.</span>

After this block add the following:

{% endfor%}

to complete the cycle.

Powered by