Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 4.35 KB

README.md

File metadata and controls

56 lines (41 loc) · 4.35 KB

Notable Growth Liquid Snippets

A collection of helpful Liquid code snippets compiled by Notable Growth. These snippets are intended for use with Braze.

As Braze uses a forked version of Liquid, the code in these snippets may not work with other services that also use Liquid.

Notable Growth is a Braze Alloy partner, we use data, creativity, and empathy in our strategic planning to connect meaningfully with our customers and deliver Notable results.

Arrays

Connected Content

Data

Voucherify Promotion Engine

Localization

  • Transifex - Connected Content GET request to v2.5 of the Transifex API. This API will be deprecated 11/30/2022.

Misc

Personalization

Dates

  • Add Days - Add a specific amount of days to an existing date. Starting date must be converted to seconds first.
  • Format Date - Format a date into ISO 8601.
  • Ordinal Date - Get the ordinal number for a date (e.g 5th, 22nd etc).
  • Calculate Days Remaining - Get the number of days remaining in the current month.

Logic

  • Abort - Abort a campaign based on the value of a variable.
  • Case When - Switch statement based on the values of a variable. Useful for displaying copy based on the language of a user.

Math

  • Compare Negative Numbers - Simple example showing how to handle comparing a negative number in Liquid. This also has an example of casting a string as a number.
  • Random Number - Generate a random number.