Blueshift

Dynamic Content

Blueshift offers various controls for personalizing your messages, as well as tools to make it easier to edit images and text blocks within the templates. We use open source version of Liquid templating language to reference and create personalized content. Messages can be personalized using the following content:

1) User - Insert user specific attributes such as firstname, lastname, email and other custom attributes that you have sent through the Identify event or by uploading customer attributes through the dashboard
2) Catalog - Reference catalog variables (such as product name, image, url, etc.) in your triggered and recurring campaigns
3) Event Specific - Refer event specific variables in your messages

The Liquid template language provides logical operators to control how you want to output user and recommendation content in your template.

Liquid Basics

Custom Liquid Filters

Certain Liquid filters that are custom to the Blueshift platform are listed below.

Shuffle Filter

This filter shuffles the items in an array.

{% assign shuffled_products = products | shuffle %}

Time Zone Filter

This filter formats ISO 8601 compliant dates into a given timezone.
Here are some examples:

{% assign sign_up_date = "Thu Nov 29 2001 14:33:20 UTC" %}
{{ sign_up_date | time_zone: 'Hong Kong' }} => 2001-11-29 22:33:20 +0800

{% assign sign_up_date = "29/11/2001 00:00:00 -0900" %}
{{ sign_up_date | time_zone: 'Hong Kong' }} => 2001-11-29 17:00:00 +0800

Since this filter returns a date, the output can be chained with a date filter to format the value:

{% assign sign_up_date = "Thu Nov 29 2001 14:33:20 UTC" %}
{{ sign_up_date | time_zone: 'Hong Kong' | date: '%d/%m/%Y %H:%M:%S %Z' }} => 29/11/2001 22:33:20 HKT

You can also pass in an hour offset instead of a timezone:

{% assign sign_up_date = "2015-12-01 10:00" %}
{{ sign_up_date | time_zone: -7 | date: '%d-%m-%Y %H:%M' }} => 01-12-2015 03:00

Here's a list of Time Zones this filter supports.

Money Filter

This filter formats numbers as currency. By default it uses the currency configured in your Account Profile

{{ 19.99 | money }} // $ 19.99
{{ '19.99' | money }} // $ 19.99

The money filter accepts the following options:

Option
Default Value
Sample Values

use symbol

true

true, false

use space

true

true, false

currency type

The currency is configurable in the Account Profile

"USD"
"EUR"
"GBP"
"INR"
"SGD"
"AED"
"SEK"
"CHF"

Here's a money filter that overrides the default account currency with Indian Rupees and eliminates the space between the currency symbol and number:

{{ 19.99 | money: true,false,'INR' }} // ₹19.99

Power Math Filter

This filter returns the input to the exponent power

{{ 2 | pow: 3 }} // 8
{{ 2 | pow: -3 }} // 1/8
{{ -2 | pow: 3 }} // -8

Dynamic Content