Document toolboxDocument toolbox

Liquid Script

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.

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

Topics

Personalization

Date

{{ "now"| date: "%m/%d/%Y" }} 

Note: For additional options visit http://strftime.net/ 

Default

{{ Object | default: "My Default" }} 

First, Last, & Email

{{ user.firstname }} {{ user.lastname }} {{ user.email }}

User Transactions (Advantage Data Objects)

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

Whitespace Control

Assigning a Value to a Variable

Output:  
This is some value

Template and Shared Asset Logic

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

Using SWITCH Statements

Using CAPTURE Statements

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



com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'html-macro' is unknown.