This document lists examples of how to use the liquid variables that are available for use in the email templates but are not currently used in the default templates.
You need to have a good understanding of the Liquid programming language to customize the templates. However, here is a brief introduction to how Liquid works.
Liquid is a template language used to render dynamic content. Liquid is written just like regular HTML markup with the addition of easy-to-read constructs, Liquid statements are built using a combination of objects, tags, and filters.
Objects
Objects contain expressions that display the variable data. Liquid objects are commonly referred to as Liquid variables. Objects are denoted by a set of double curly braces containing the variable expression.
{{ variable_goes_here }}
Tags
Tags display the logic that tells the template what data to display. Tags are denoted by a set of curly brace percentage delimiters.
{% logic_goes_here %}
E.g. To print out the payment instructions if the order uses COD.
{% if order.using_cod? %} <h3>Payment Instructions</h3> <p>{{ order.payment_instructions }}</p> {% endif %}
Filters
Filters are used to change the output of a liquid variable. Filters tell the template how to format the data. You can invoke filters by following the value in an object with a pipe character (|), followed by the name of the filter. E.g.
{{ balance | format_currency }}
Click on the links below to see examples of how to use the liquid variables that are not used in the default templates.
Non-Default Variable Usage Examples
- How to Show Parent Store Name Instead of Fulfillment Center in the Campaign Created Email Template
- How to Show Sales Team Member Name in Quote/Order Sent to Customer Emails
- How to Show Part Name Rather than Full Name in Email Templates
- How to Show the Category of a Pre-decorated Product in the Site-made-a-sale Email Template
- How to Show Product Colors in the Site-made-a-sale Email Template
- How to Show the Customer Details & Notes in Team Member Emails
Comments
0 comments
Please sign in to leave a comment.