Liquid tag list

This page contains a list of the liquid tags, variables, and filters available to you in Customer.io. Use the search bar below to look for a specific tag.

Our version of Liquid is currently 2.5.3. If you can’t find an answer to your liquid-related question below, we also have our own syntax guide.

Looking for something specific?

  • Customer.io Tags

    These are values generated by, or stored within, Customer.io. Reference these values to import information for a person. Many of the .id values are useful as UTM parameters in links, so you can log where your traffic is coming from or attribute customer actions to messages.

  • content

    Use in layouts to indicate where code added via the email editor will be included. You might use this in a template for a transactional message or API-triggered broadcast where you will provide content from the API directly.

    Example
    {{content}}
    
  • unsubscribe_url

    Renders a unique unsubscribe link for a customer and their email-address.

    Syntax
    {% unsubscribe_url %}
    
  • view_in_browser_url

    Our default link that generates a web version of your email, personalized for each recipient. In general, these URLs look something like: http://e.customeriomail.com/deliveries/....

    Syntax
    {% view_in_browser_url %}
    
  • layout.id

    The numerical ID associated with the email layout you’ve used.

    Syntax
    {{layout.id}}
    
  • layout.name

    The name assigned to the email layout you’re using.

    Syntax
    {{layout.name}}
    
  • campaign.id

    Your campaign’s numerical ID. This can be found in your campaign URL. For example, the campaign ID here is 2000: https://fly2.customer.io/env/12345/v2/campaigns/2000/overview.

    Syntax
    {{campaign.id}}
    
  • campaign.name

    The name that you assigned your campaign or newsletter. For example: “Q2 Anvil Onboarding Campaign [Coyotes]”.

    Syntax
    {{campaign.name}}
    
  • campaign.type

    This returns whether or not your campaign is behavioral (segment triggered), transactional (event triggered), or a newsletter.

    Syntax
    {{campaign.type}}
    
  • message.id

    The numerical ID for a message action in the workflow. For example, an SMS action might have a {{message.id}} of 200. Note that this identifies the action in your workflow, not the individual delivery instances. Every SMS delivery generated from the action would have a different {{delivery_id}}.

    Syntax
    {{message.id}}
    
  • message.journey_id

    The ID for the path a person went through in a Campaign or API Triggered Broadcast workflow. You can use this value to trace message metrics back to a person’s path through a journey using the journey.id value sent in our Reporting Webhooks.

    Syntax
    {{message.journey_id}}
    
  • message.name

    The name you give your message in the workflow, like “Welcome to ACME!”

    Syntax
    {{message.name}}
    
  • message.type

    This refers to a particular message’s type. Possible values are: email_action, twilio_action, slack_action, webhook_action, urban_airship_action, attribute_update_action.

    Syntax
    {{message.type}}
    
  • message.subject

    If your message has a subject, or the message subject is different from the message name, this tag echos it.

    Syntax
    {{message.subject}}
    
  • event_name

    The name of the event that triggers a campaign.

    Syntax
    {{event_name}}
    
  • delivery_id

    A URL-compatible base64 string that identifies an instance of a message created for a person. This is set to unsent in test send and composer previews, and generated when the message is drafted or sent.

    Syntax
    {{delivery_id}}
    
  • Variables and Assignment

    There are common variables you can reference within messages and elsewhere. These may be variables associated with a person, the event triggering a message workflow, or variables that you assign within your message from other values.

  • customer attributes

    You reference customer attributes—data associated directly with a person in Customer.io—in the customer scope. You may want to use customer attributes with an if conditional, so that you have text to fallback to if a customer doesn’t have the attribute in question.

    Syntax
    {{customer.<attribute_name>}}
    
    Example
    {%if customer.name%}
      Hi {{customer.name | capitalize}}
    {%else%}
      Hi Buddy
    {%endif%}
    
  • event properties

    If you trigger a campaign using an event, you can reference properties from the event that triggers your campaign in the event scope. You may want to use event properties with an if conditional, so that you have text to fallback to if an event doesn’t have the property in question or your property doesn’t contain the value you expect.

    Syntax
    {{event.<property>}}
    
    Example
    {%if event.type == "purchase"%}
      Thanks for your purchase!
    {%else%}
      Thanks for using our service!
    {%endif%}
    
  • trigger properties

    You can reference properties from the data object when you trigger a transactional message or API-trigger a broadcast using the trigger scope. This provides a convenient way to pass event data into transactional and broadcast templates. You may want to use trigger properties with an if conditional, so that you have text to fallback to if your trigger data is incomplete or contains values you don’t expect.

    Syntax
    {{trigger.<data.property>}}
    
    Example
    {%if trigger.first_name%}
      Hi {{trigger.first_name | capitalize}}
    {%else%}
      Hi Buddy
    {%endif%}
    
  • assign

    Assign a value to a variable.

    Syntax
    {% assign var_name = 'value' %} 
    
    Input
    {% assign favorite_food = 'apples' %} 
    
    Output
    {{ favorite_food }}
    
  • capture

    Captures contents and assigns them to a variable.

    Input
    {% capture about_me %}I am 28 and my favorite food is pasta.{% endcapture %}
    
    Output
    {{ about_me }}
    
  • Logical Operators

    Logical operators determine the basic rules for evaluating true or false statements. You can also use and and or operators to combine logic statements to evaluate multiple conditions.

  • equals (==)

    Use == to check if two values are equal to each other.

    Example
    {%if customer.name == "daffy duck"%}
      Wabbit season!
    {%else%}
      Duck season!
    {%endif%}
    
  • Does not equal (!=)

    Use != to check that two values are not equal to each other.

    Example
    {%if customer.name != "daffy duck"%}
      Duck season!
    {%else%}
      Wabbit season!
    {%endif%}
    
  • Greater than and Greater than or equal to (>, >=)

    Use > to match when one value is greater than another. Use >= to match when one value is greater than or equal to another.

    Syntax
    {% val1 > val2 %}
      // do something if val1 is greater than val2
    {% endif %}
    
    Example
    {% customer.acct_age_years > 1 %}
      Thanks for being with us these past years
    {% else %}
      Thanks for spending the last year with us!
    {% endif %}
    
  • Less than and less than or equal to (>, >=)

    Use < to match when one value is less than another. Use <= to match when one value is less than or equal to another.

    Syntax
    {% if val1 < val2 %}
      // do something if val1 is less than val2
    {% endif %}
    
    Example
    {% customer.purchases < 5 %}
      Thanks for 
    {% else %}
      Thanks for spending the last year with us!
    {% endif %}
    
  • and

    Evaluate a statement as true when both conditions are true.

    Syntax
    {% condition1 and condition2 %}
      // do something if both condition1 and condition 2 are true
    {% endif %}
    
    Example
    {% customer.name == "bugs bunny" and event.episode_start == true %}
      What's up doc?
    {% else %}
      That's all folks!
    {% endif %}
    
  • or

    Evaluate a statement as true when either of two conditions are true.

    Syntax
    {% condition1 or condition2 %}
      // do something if either condition1 and condition 2 are true
    {% endif %}
    
    Example
    {% customer.name == "bugs bunny" or customer.group == "looney toons" %}
      That's all folks!
    {% else %}
      See you later!
    {% endif %}
    
  • Loops and Conditionals

    Loop through an array of items or set conditions determining the content that you want to show.

  • case

    Creates a set of conditions depending on a variable’s specific value—like a set of if, if-else, else conditions.

    For example, you might use this to display different text depending on if a customer lives in a specific country.

    Syntax
    {% case condition %}
      {% when "value1" %}
        text when condition is value1.
      {% when "value2" or "value3" %}
        text when condition is value2 or value3
      {% else %}
        text when condition does not match other conditions
    {% endcase %}
    
  • for loop

    Repeatedly executes a block of code, most commonly to perform an operation for each item in an array. You might use a for loop in a message to provide a receipt of purchases (assuming an array of items in a purchase). Find more information about for loops and iteration here.

    Syntax
    {% for item in array %}
      {{ item }}
    {% endfor %}
    
    Example
    {% for product in event.products %}
      - {{ product.title }} x {{ product.price }}
    {% endfor %}
    
  • if

    Executes a block of code if a condition is met. Use elsif to add multiple ‘if’ conditions and else for the block of code you want to execute if all conditions are false. Find more information about conditional liquid here.

    Example
    {% if customer.name == "chad" %}
      Hey Chad!
    {% elsif customer.name != "chad" %}
      Hey {{ customer.name | capitalize }}!
    {% else %}
      Hi Buddy!
    {% endif %}
    
  • unless

    Like an if conditional, but reversed: this tag executes a block of code if your condition is not met.

    Example
    {% unless product.name == "cool beans" %}
      The beans are not cool.
    {% endunless %}
    
  • Timestamps and Dates

    Use these tags to get and manipulate dates and times.

  • event_timestamp

    The UNIX timestamp when a particular event was performed. This time is different from now!

    Syntax
    {{event_timestamp}}
    
  • now

    The current time in UTC. You must format time with date.

    To modify date or time with add or subtract filters you must convert now into a unix timestamp first using date: '%s'.

    Example
    {{ 'now' | date: '%H:%M %p %B %d, %Y' }}
    {{ 'now' | date: '%s' | plus: 0 | add_day: 1 | date: '%Y-%m-%d %H:%M'}}
    
    Output
    08:28 AM May 11, 2021
    08:28 AM May 12, 2021
    
  • add_year

    Adds a year, or multiple years, to a given timestamp.

    Syntax
    {{ <unix_timestamp> | add_year: <int_years> }}
    
    Example
    {{ 1477430251 | add_year: 4 }}
    
  • add_month

    Adds a month, or multiple months, to a given timestamp.

    Syntax
    {{ <unix_timestamp> | add_month: <int_months> }}
    
    Example
    {{ 1477430251 | add_month: 7 }}
    
  • add_day

    Adds a day, or multiple days, to a given timestamp.

    Syntax
    {{ <unix_timestamp> | add_month: <int_days> }}
    
    Example
    {{ 1477430251 | add_day: 7 }}
    
  • subtract_year

    Subtracts a year, or multiple years, to a given timestamp.

    Syntax
    {{ <unix_timestamp> | subtract_year: <int_years> }}
    
    Example
    {{ 1477430251 | subtract_year: 4 }}
    
  • subtract_month

    Subtracts a month, or multiple months, to a given timestamp.

    Syntax
    {{ <unix_timestamp> | subtract_month: <int_months> }}
    
    Example
    {{ 1477430251 | subtract_month: 2 }}
    
  • subtract_day

    Subtracts a day, or multiple days, to a given timestamp.

    Syntax
    {{ <unix_timestamp> | subtract_day: <int_days> }}
    
    Example
    {{ 1477430251 | subtract_day: 7 }}
    
  • timezone

    Converts a timestamp to a timezone you specify. You can use now instead of a timestamp. Timezone inputs can be -3 (specify your number) or UTC

    Example
    {{ 1483272000 | timezone: '-8' | date: '%H:%M, %a, %b %d, %Y'}}
    
    Output
    04:00, Sun, Jan 01, 2017
    
  • date

    Format a date. Use the Ruby syntax reference for more information about date formatting syntax.

    Input
    {{ 1483272000 | date: '%H:%M, %a, %b %d, %Y'}}
    
    Output
    12:00, Sun, Jan 01, 2017
    
  • Array Filters

    Liquid used to filter and manipulate arrays (lists of values). If your event or another incoming value is an array, you may iterate over the array with a for loop or grab items at a particular index of the array, to display information for your audience.

  • first

    Returns the first element of the array.

    Input
    acme.characters = ["Wile E Coyote", "Road Runner"]
    {{ acme.characters | first }}
    
    Output
    Wile E Coyote
    
  • last

    Returns the last element of the array.

    Input
    acme.characters = ["Wile E Coyote", "Road Runner"]
    {{ acme.characters | last }}
    
    Output
    Road Runner
    
  • join

    Joins the elements of an array with the character passed as the parameter.

    Input
    acme.characters = ["Wile E Coyote", "Road Runner"] 
    {{ acme.characters | join: ', ' }}
    
    Output
    Wile E Coyote, Road Runner
    
  • sort

    Sorts the elements of an array by an attribute of an element in that array. Usually used with a ‘for’ loop. The order of the sorted array is case-sensitive!

  • map

    Creates an array of values by extracting the values of a property in an object. You can output your new characters in a ‘for’ loop.

    Input
    Array of objects: [{"name":"coyote"},{"name":"bugs"},{"name":"tweety"}]"
    {% assign names = customer.characters | map: 'name' %}
    
    Output
    coyote, bugs, tweety
    
  • size

    Returns the number of characters (the size) of a string (in characters) or the number of elements in an array.

    Input
    {{ "That's all, folks!" | size }}
    
    Output
    18
    
  • remove

    Remove an element from an array. The array can contain objects of any type.

    Input
    {% assign pl = collection.products | remove: collection.products[0] %}
    - {{ collection.products.size }}
    - {{ pl.size }}
    
    Output
    - 2 
    - 1
    
  • where

    Creates an array including only the objects with a given property value, or any “truthy” value by default. When using where, you provide two items separated by a comma: the key you want to match on and the value you want to match. For example, this:

    `

    Input
    All Players:
    {% for player in collection.players %} 
      - {{ player.last_name }} 
    {% endfor %} 
    
    Baseball Players:
    {% assign baseball_players = collection.players | where: "sport", "baseball" %} 
    {% for player in baseball_players %} 
      - {{ player.last_name }} 
    {% endfor %}
    
    Output
    All Players: 
      - Posey 
      - Lincecum 
      - Montana 
      - Rice 
    
    Baseball Players: 
      - Posey 
      - Lincecum
    
  • where_not

    Creates an array of items that do not match a given property value, or any “falsey” value by default. When using where_not, you provide two items separated by a comma: the key you want to match on and the value you want to match.

    Input
    All players: 
    {% for player in collection.players %} 
      - {{ player.last_name }} 
    {% endfor %} 
    
    Not baseball players: 
    {% assign not_baseball_players = collection.players | where_not: "sport", "baseball" %} 
    {% for player in not_baseball_players %} 
      - {{ player.last_name }} 
    {% endfor %}
    
    Output
    All players: 
      - Posey 
      - Maradona 
      - Montana 
      - Gretzky 
      - Jordan 
    
    Not baseball players: 
      - Maradona 
      - Montana 
      - Gretzky 
      - Jordan 
    
  • concat

    Concatenates arrays, joining them end to end. The resulting array contains all of the elements of both original arrays. concat does not remove duplicate entries unless you also use the uniq filter.

    Input
    {% assign stones = "mick, keith, ronnie, charlie" | split: ", " %} 
    {% assign beatles = "john, paul, george, ringo" | split: ", " %} 
    {% assign rolling_beatles = stones | concat: beatles %} 
    {{ rolling_beatles | join: ", " }}
    
    Output
    mick, keith, ronnie, charlie, john, paul, george, ringo
    
  • sort_natural

    Sort the items in an array in case-insensitive order.

    Input
    {{ "mick, keith, Charlie, Ronnie" | sort_natural }}
    
    Output
    Charlie, keith, mick, Ronnie
    
  • compact

    Removes nil (empty) values from an array.

    Input
    {{ "mick, keith, nil, Charlie" | compact }} 
    
    Output
    mick, keith, Charlie
    
  • remove

    Removes an element from an array. The array can contain objects of any type.

    Input
    {% assign pl = collection.products | remove: collection.products[0] %}
    {{ collection.products.size }}
    {{ pl.size }}
    
    Output
    2
    1
    
  • uniq

    Removes duplicate elements in an array.

    Input
    {% assign my_array = '"lions", "tigers", "bears", "bears", "lions"' %}
    {{ my_array | uniq | join: ", " }} 
    
    Output
    lions, tigers, bears
    
  • cycle

    In a ‘for’ loop, this tag loops through and outputs strings in the order they were passed.

    Input
    <ul>
    {% assign customer.characters = ["coyote","bugs","tweety"] %} {% for character in customer.characters %} 
    <li class="{% cycle 'odd', 'even' %}">{{ character }}</li> 
    {% endfor %}
    </ul>
    
    Output
    <ul> 
      <li class='odd'>coyote</li>
      <li class='even'>bugs</li> 
      <li class='odd'>tweety</li> 
    </ul>
    
  • Number and Currency Filters

    These are tags and filters that manipulate incoming number, integer, and timestamp values.

  • floor

    Rounds a number down to the nearest integer.

    Input
    {{ 3.14 | floor }}
    
    Output
    3
    
  • ceil

    Rounds a number up to the nearest integer.

    Input
    {{ 3.14 | ceil }}
    
    Output
    4
    
  • abs

    Returns the absolute value of a number.

    Input
    {{ 3.14 | abs }}
    
    Output
    3.14
    
  • round

    Rounds a number up or down to the nearest integer, or to a decimal place you specify.

    Input
    {{ 4.32 | round }} 
    {{ 4.32 | round: 1 }}
    
    Output
    4
    4.3
    
  • rounded_currency

    Rounds a number into the nearest whole integer and formats it to a currency. For exapmle, You cannot use the locale: option with rounded_currency like you can with the standard currency filter.

    Input
    {{ 3.1415 | rounded_currency }}
    
    Output
    $3
    
  • format_number

    Format a number with a delimiter. This filter also takes an optional localization parameter to format a number for a specific locale.

    NOTE: This replaces the former number_with_delimeter filter.

    Input
    {{ 10000 | format_number }}
    {{ 123456.78 | format_number: "fr" }} 
    
    Output
    10,000
    123 456,78
    
  • Localization Parameters

    Some Liquid tags, like the currency and format_number tags, take an optional localization parameter, formatting the output for a specific locale. These tags use the format {{ 10 | currency: "en-us" }}, which would output $10.00.

    We support the following localization values.

    af, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, de-AT, de-CH, de-DE, el, el-CY, en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-US, en-ZA, en-CY, en-TT, eo, es, es-419, es-AR, es-CL, es-CO, es-CR, es-EC, es-ES, es-MX, es-NI, es-PA, es-PE, es-US, es-VE, et, eu, fa, fi, fr, fr-CA, fr-CH, fr-FR, gl, he, hi, hi-IN, hr, hu, id, is, it, it-CH, ja, ka, km, kn, ko, lb, lo, lt, lv, mk, ml, mn, mr-IN, ms, nb, ne, nl, nn, oc, or, pa, pl, pt, pt-BR, rm, ro, ru, sk, sl, sq, sr, st, sw, ta, te, th, tl, tr, tt, ug, ur, uz, vi, wo, zh-CN, zh-HK, zh-TW, zh-YUE
    

  • to_json

    Outputs the json representation of the input. For example, {{ customer | to_json }} sends all your customer data into a JSON variable.

    Example
    {{ customer | to_json }}
    
  • random

    Generates a random number between 0 and an integer you specify.

    Example
    {% random 100 %}
    
  • currency

    Converts an integer to currency. This filter can also take an optional localization parameter to format currency for a specific locale.

    Input
    {{ 10 | currency }}
    {{ 123456.78 | currency: "fr" }}
    
    Output
    $10.00
    123 456,78€
    
  • Math Filters

    Filters that perform math operations on incoming number or integer values.

  • minus

    Subtracts a number from another number.

    Input
    {{ 10 | minus: 1 }}
    
    Output
    9
    
  • plus

    Adds a number to another.

    Input
    {{ 10 | plus: 1 }}
    
    Output
    11
    
  • times

    Multiplies a number by another number.

    Input
    {{ 5 | times: 2 }}
    
    Output
    10
    
  • divided_by

    Divides a number by another number.

    Input
    {{ 10 | divided_by: 4 }}
    {{ 10 | divided_by: 4.0 }}
    
    Output
    2
    2.5
    
  • modulo

    Returns the remainder of division.

    Input
    {{ 3 | modulo: 2 }}
    
    Output
    1
    
  • at_least

    Limits a number to a minimum value.

    Input
    {{ 41 | at_least: 42 }}
    
    Output
    42
    
  • at_most

    Limits a number to a maximum value.

    Input
    {{ 100 | at_most: 99 }}
    
    Output
    99
    
  • String Filters

    The following filters manipulate strings in templates. You might use these to truncate or set the case of strings you reference from other places, to humanize your messages for recipients.

  • contains

    Finds a substring inside a string, or the presence of a string in an array of strings. This filter only works with strings; you cannot use it to search for an object in an array of object.

    Syntax
    {% if product.description contains 'lorem ipsum' %}
      You might also be interested in Fillerama or Office Ipsum.
    {% endif %}
    
  • escape

    Escaping (or encoding) a string removes special characters.

    Input
    {{ "win+help@customer.io" | escape }}
    
  • escape_once

    Escapes or encodes a string, but doesn’t include already-escaped characters.

    Input
    {{ "1 < 2 & 3" | escape_once }}
    
    Output
    1 < 2 & 3
    
  • htmlencode

    Escapes HTML characters into HTML entities.

  • urlencode

    Escapes/encodes URL-unsafe characters in a string.

    NOTE: For email addresses, you should use the escape filter instead, as some characters that are allowed in email addresses (i.e., + and @) are not considered URL-unsafe characters and they will not be replaced by this filter.

    Input
    {{ "Hello, world!" | urlencode }}
    
    Output
    Hello, world! 
    
  • base64

    Base64-encodes a string.

    Input
    {{ 'Hello, world!' | base64 }}
    
    Output
    SGVsbG8sIHdvcmxkIQ==
    
  • capitalize

    Capitalize the first character in a string.

    Input
    {{ "hello world" | capitalize }}
    
    Output
    Hello world
    
  • downcase

    Converts a string to lower case.

    Syntax
    {{ 'STRING' | downcase }}
    
    Input
    {{ "ACME" | downcase }}
    
    Output
    acme
    
  • upcase

    Converts a string to upper case.

    Syntax
    {{ 'string' | upcase }}
    
    Input
    {{ 'acme' | upcase }}
    
    Output
    ACME
    
  • titlecase

    Converts a string to title case.

    Syntax
    {{ 'string' | titlecase }}
    
    Input
    {{ "rocket roller skates" | titlecase }}
    
    Output
    Rocket Roller Skates
    
  • slice

    Returns the character located at the index specified in the first argument. You can also provide a second argument indicating the length of the string you want to return (if you want to return multiple characters).

    If the first argument is a negative number, the index is begins from the end of the string.

    Syntax
    {{ "string" | slice: <req, index of char>, <optional, length of result> }}
    
    Input
    {{ "Customer.io" | slice: 3 }}
    {{ "Customer.io" | slice: 3, 3 }}
    {{ "Customer.io" | slice: '-4', 3 }}
    
    Output
    t
    tom
    r.i
    
  • strip_html

    Removes HTML characters from a string.

    Input
    {{ "Eh, what's <i>up</i>, <b>Doc</b>?" | strip_html }}
    
    Output
    Eh, what's up, Doc?
    
  • pluralize

    Outputs the singular or plural version of a string based on the value of a number. The first parameter is the singular string and the second parameter is the plural string.

    Syntax
    {{ int-val | pluralize 'singular', 'plural'}}
    
    Input
    {{ event.item_count | pluralize: 'item', 'items' }}
    
    Output
    3 items
    
  • url_encode

    Converts URL-unsafe characters in a string into percent-encoded characters. This filter also converts spaces to + characters.

    Input
    {{ "cio@example.com" | url_encode }}
    
    Output
    cio%40example.com
    
  • url_decode

    Decodes a string that has been encoded as a URL or has been modified by url_encode.

    Input
    {{ "%27Customer.io+is+great%27" | url_decode }}
    
    Output
    Customer.io is great
    
  • strip

    Strips all whitespace, including tabs, spaces, and newlines, from the left and right side of a string.

    Input
    text{{ " Customer.io " | strip }}text
    
    Output
    Customer.io
    
  • lstrip

    Strips all whitespace, including tabs, spaces, and newlines, from the left side of a string.

    Input
    text{{ " Customer.io " | lstrip }}text
    
    Output
    textCustomer.io text
    
  • rstrip

    Strips all whitespace, including tabs, spaces, and newlines, from the right side of a string.

    Input
    text{{ " Customer.io " | rstrip }}text
    
    Output
    text Customer.iotext
    
  • strip_newlines

    Removes line breaks (\n) from a string.

    Example
    {{ product.description | strip_newlines }}
    
  • newline_to_br

    Replaces newline with an HTML line break. input: See this example for output.

    Input
    <br />
    Customer.io<br />
    liquid<br />
    
  • replace

    Find and replace values within a string. The first argument represents the value you want to replace, and the second argument is the replacement.

    Syntax
    {{ "String you want to replace values in" | replace: "find-str", "replace-str" }}
    
    Input
    {{ "Coyotes never catch roadrunners!" | replace: "never", "always" }}
    
    Output
    Coyotes always catch roadrunners!
    
  • replace_first

    Find and replace the first match in a string. The first argument represents the value you want to replace, and the second argument is the replacement.

    Syntax
    {{ "String you want to replace values in" | replace_first: "find-str", "replace-str" }}
    
    Input
    {{ "roller rocket roller skates" | replace_first: "roller", "awesome" }}
    
    Output
    awesome rocket roller skates
    
  • remove

    Removes a value from a string.

    Input
    {{ "And that's all, folks!" | remove: ", folks" }}
    
    Output
    And that's all!
    
  • remove_first

    Removes the first occurrence of a value from a string.

    Input
    {{ "folks that's all, folks!" | remove_first: "folks" }}
    
    Output
    that's all folks!
    
  • truncate

    Shortens a string to the specified number of characters, adding an ellipsis if the string is longer than the value provided.

    Input
    {{ "I knew I shoulda taken that left turn at Albuquerque." | truncate: 20 }}
    
    Output
    I knew I shoulda ...
    
  • truncatewords

    Shortens a string to a specified number of words, rather than characters, and adds an ellipsis if the string contains more words than the value provided.

    Input
    {{ "I knew I shoulda taken that left turn at Albuquerque." | truncatewords: 8 }}
    
    Output
    I knew I shoulda taken that left turn...
    
  • prepend

    Adds a string to the beginning of another string.

    Input
    {{ "Sufferin' succotash!" | prepend: "Sylvester: " }}
    
    Output
    Sylvester: Sufferin' succotash!
    
  • append

    Adds a string to the end of another string.

    Input
    {{ "What's all the hubbub, " | append: "bub?" }}
    
    Output
    What's all the hubbub, bub?
    
  • split

    Divides an input string into an array using a separator you define. This filter is often used with a for loop.

    Input
    {% assign rolling_stones = "Mick, Keith, Ronnie, Charlie" | split: ", " %}
    
    {% for member in rolling_stones %}
      {{ member }}
    {% endfor %}
    
  • md5

    Converts a string into an md5 hash.

    Input
    {{ "Customer.io" | md5 }}
    
    Output
    d52b6a207bf5255c05b1d0056230617e
    
  • sha1

    Converts a string into a sha1 hash.

    Input
    {{ "Customer.io" | sha1 }}
    
    Output
    c197ff0ae0a41983362f35ca972c544061c54d4c
    
  • sha256

    Converts a string into a sha256 hash.

    Input
    {{ "Customer.io" | sha256 }}
    
    Output
    6dddb773238216bce273133bc3f6a12a824f41dd184d09452f05c7659dae7d57
    
  • hmac_sha1

    Converts a string into an hmac_sha1 hash.

    Input
    {{ "Customer.io" | hmac_sha1: "some_key" }}
    
    Output
    2bdf556c9a75766f258d1e2824f6d0e31d1beedc
    
  • hmac_sha256

    Converts a string into an hmac_sha256 hash.

    Input
    {{ "Customer.io" | hmac_sha256: "some_key" }}
    
    Output
    6dddb773238216bce273133bc3f6a12a824f41dd184d09452f05c7659dae7d57
    
  • hex_base64

    Returns a base64 encoding of a hex digest, like ones returned by the hmac_sha256 filter.

    Input
    {{ "Customer.io" | hmac_sha256: "some_key" | hex_base64 }}
    
    Output
    bd23cyOCFrzicxM7w/ahKoJPQd0YTQlFLwXHZZ2ufVc=
    
  • Miscellaneous

    These are tags that you can use to escape liquid rendering or escape rendering all together.

  • comment

    This tag doesn’t show its contents, providing a way for you to leave notes inside templates for other members of your organization.

    Syntax
    {% comment %} Don't display me! {% endcomment %}
    
  • raw

    Temporarily disables Liquid processing. You might use this to escape tag processing if you use a conflicting syntax or you want to show raw liquid syntax in your message."

    Example
    {% raw %}
      {{This}} is displayed exactly as typed.
    {% endraw %}