Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Liquid Script is an open source scripting language that can be used to personalize content in an email. You can use any data point within Blueshift to conditionally hide, show, or modify content in an email allowing you to create campaigns that dynamically adapt to the customer.

Info

For more information beyond the basics covered here, visit the Liquid Script External Wiki.

Topics

Table of Contents
maxLevel3
minLevel2
indent20px
stylenone

...

Note: For a list of available advantage data objects, please see the Data Object Map.

Whitespace Control

Code Block
languagexml
<!--If Liquid Script is causing formatting issues, try using the minus sign (-) inside your tags-->
{%- some liquid script -%} 

...

The following markup examples are shown using the list_code data object mapped from Advantage to Blueshift. You can use any data object available to create dynamic content within a template. You can also use values assigned to variables within other liquid script markup. Liquid script values can be passed between templates and shared assets in both directions. You can also pass values from one shared asset to another as long as both are used within the same template.

Note: When using transaction data in your logic, the list, publication, or product you have starred in your advanced segment will be referenced. For more information, please see Creating Advanced Segments

Using IF Statements

Code Block
languagexml
{% if user_transaction.list_code == "ABC" %} 
  Show ABC content 
{% elsif user_transaction.list_code == "XYZ" %} 
  Show XYZ content 
{% else %} 
  Show default content or warning 
{% endif %} 

...

Output:  
Hi Jane,
Thank you for subscribing. To login, visit our website.