Personalization

LivePinch provides powerful personalization features. This document requires you to understand Profiles and Events section. This document provides an introduction to personalization within any of the messages. Basic widgets for inserting placeholders are provided in most of the dashboard.

../_images/personalize-wizard.png

Basic User Sytem Attributes

1
2
3
 {{ user.system_attributes.first_name }}
 {{ user.system_attributes.last_name }}
 {{ user.system_attributes.phone }}

Basic User Custom Attributes Attributes

1
2
 {{ user.custom_attributes.membership_level }}
 {{ user.custom_attributes.number_of_purchases }}

Note

Note on custom attributes, When attributes are set, Almost any label can be used used to set the attributes. These names are saved as it is. However, within templates these keys are accessed with modified keys. The rules are modification are

  • Key are lowercased
  • Any non-number and non-letter characters are removed
  • One or more spaces are translated into _

As an example “Add to Cart” will be made add_to_cart

Quick Examples

Substitute a value or if the value not present use a default value

1
 {{ user.system_attributes.first_name | default: "Customer" }}

Prepend a string

1
 {{ user.system_attributes.first_name | prepend: "Dear " }}

Append a string

1
 {{ user.system_attributes.first_name | append: "," }}

Capitalize

1
 {{ user.system_attributes.first_name | capitalize }}

Lowercase

1
 {{ user.system_attributes.first_name | downcase }}

Uppercase

1
 {{ user.system_attributes.first_name | upcase }}

Count number of characters of the text

1
 {{ user.system_attributes.last_name | size }}

Truncate to number of characthers

1
 {{ user.system_attributes.last_name | truncate: 20 }}

Strip Trailing whitespace

1
 {{ user.system_attributes.last_name | rstrip }}

Strip Leading whitespace

1
 {{ user.system_attributes.last_name | lstrip }}

Strip both leading and trailing whitespace

1
 {{ user.system_attributes.last_name | strip }}

Split text

1
2
3
4
5
 {% assign beatles = "John, Paul, George, Ringo" | split: ", " %}

 {% for member in beatles %}
   {{ member }}
 {% endfor %}

Sort

1
2
3
4
5
 {% assign beatles = "John, Paul, George, Ringo" | split: ", " | sort %}

 {% for member in beatles %}
   {{ member }}
 {% endfor %}

Unique

1
2
3
4
5
 {% assign beatles = "John, Paul, George, Ringo" | split: ", "  | sort  | uniq %}

 {% for member in beatles %}
   {{ member }}
 {% endfor %}

Round down a numeric value

1
 {{ user.system_attributes.total_purchases | floor }}

Round up a numeric value

1
 {{ user.system_attributes.total_purchases | ceil }}

Round to the closest whole number

1
 {{ user.system_attributes.total_purchases | round }}

Multiply

1
 {{ user.system_attributes.total_purchases | multiply: 5}}

Add

1
 {{ user.system_attributes.total_purchases | plus: 5}}

Subtraction

1
 {{ user.system_attributes.total_purchases | minus: 5}}

Divide

1
 {{ user.system_attributes.total_purchases | divide_by: 5}}

Reminder

1
 {{ user.system_attributes.total_purchases | modulo: 5}}

Control Flow

You can use following comparison operators >, >=, <, <=, ==

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 {% if user.system_attributes.total_purchases > 10 %}
   {{ user.system_attributes.total_purchases }}
 {% elsif user.system_attributes.total_purchases < 10 %}
   Hello
 {% else %}
   Else
 {% endif %}

 {% unless user.system_attributes.total_purchases > 10 and user.system_attributes.name contains "delta18" %}
   {{ user.system_attributes.total_purchases }}
 {% endunless %}

 {% unless user.system_attributes.total_purchases > 10 and user.system_attributes.name contains "delta18" %}
   {{ user.system_attributes.total_purchases }}
 {% endunless %}

Iteration

Take a look at Liquid Documentation for full details on iteration

1
2
3
 {% for product in collection.products %}
   {{ product.title }}
 {% endfor %}