Using Liquid Language Template
Rather than show the same content across all your wallet passes and text messages, you’ll likely want to personalize mobile experiences with the use of variables. To do so, Vibes uses a system known as the Liquid Template Language framework from Shopify.
In the scenarios below, we’ll demonstrate a few ways you may want to use the tags and filters to output data for your customer. However, keep in mind that the most comprehensive information about Liquid Template Language is found in Shopify’s documentation.
What is Liquid Template Language?
This framework makes it possible to insert variables to your mobile passes and messages, which will change for each customer based on their unique customer data. We often refer to these variables and their outputs as “tokens” or “variable tags”.
In addition to simply displaying variables, the language’s Liquid Format Filters allow you to edit the formatting, append additional data, remove data, make calculations (including date manipulation), and much more.
Date & Time Format Filters
Format filters take a field and format it into a human-readable output. Dates are stored in ISO 8601 format in the UTC timezone.
Commonly Used Filters
Below is a table of some commonly used format filters. Please note th is not an exhaustive list, and users should refer to Shopify's documentation for more.
Filter | Description | Example Output for 20240101T000000Z |
---|---|---|
%d | Day of the month represented in 2 digits | 01 |
%m | Month of the year represented in 2 digits | 01 |
%B | Month of the year written out completely | January |
%b | Month of the year abbreviated into 3 characters | Jan |
%y | Year represented in 2 digits | 24 |
%Y | Year represented in 4 digits | 2024 |
%j | Day of the year, from 1 to 366 | 1 |
%H | Hour of the day, 24-hour clock (00 to 23) | 00 |
%I | Hour of the day, 12-hour clock (01 to 12) | 01 |
%M | Minute of the hour (00 to 59) | 00 |
%S | Second of the minute (00 to 59) | 00 |
%A | Day of the week written out completely | Monday |
%a | Day of the week abbreviated into 3 characters | Mon |
%u | Day of the week in number form, with Monday equaling 1 | 1 |
%w | Day of the week in number form, with Sunday equaling 1 | 2 |
Commonly Used Formats
Format | Example Output for 20240101T000000Z |
---|---|
"%d/%m/%Y" | 01/01/2024 |
"%m-%d-%y" | 01-01-2024 |
"%B %d, %Y" | January 01, 2024 |
Additional resources
See Shopify's liquid cheat sheet for more information.
Updated 15 days ago