Email template fields

Reference for the placeholders and layout blocks you can put in an email template. Templates use Mustache syntax: write a field as {{field}} and it is replaced with the real value when the email is sent. A field the email has nothing to say about is empty, so wrap anything optional in a section ({{#field}}...{{/field}}) to keep it out of the email.

The editor's Insert field button lists every field on this page and drops it into the template at the cursor.

The template editor with the Insert field list open

Customer

FieldTag
First name{{customer.firstName}}
Last name{{customer.lastName}}
Email{{customer.email}}

Site

FieldTag
Name{{site.name}}
URL{{site.url}}
Address{{site.address}}
Unsubscribe URL{{site.unsubscribeUrl}}

{{site.unsubscribeUrl}} is a per-customer link where they can stop receiving marketing email and opt back in. Every default footer renders it inside a {{#site.unsubscribeUrl}} section so it disappears from previews and from mail with no recipient to unsubscribe. Leave it in place.

Order

FieldTag
Number{{order.number}}
Date{{order.date}}
Status{{order.status}}
Review URL{{order.reviewUrl}}
Has other items{{order.hasOtherItems}}
Other items{{order.otherItems}}
Every item{{order.items}}

{{order.reviewUrl}} opens the review form for the order's first item and already carries a query string, so add extra parameters with &. The star links in the default review survey use {{order.reviewUrl}}&rating=1 to preselect a rating.

{{order.otherItems}} repeats for every item after the first, with {{title}} and {{reviewUrl}} inside it; {{order.hasOtherItems}} wraps anything that should only appear when the order has more than one item:

{{#order.hasOtherItems}}
<p>Review another item from your order</p>
{{#order.otherItems}}
<p><a href="{{reviewUrl}}">{{title}}</a></p>
{{/order.otherItems}} {{/order.hasOtherItems}}

{{order.items}} is the same list with the first item included, with {{title}}, {{imageUrl}} and {{reviewUrl}} inside. The guided reviews setup writes this when you pick "List every product equally":

{{#order.items}}
<p><a href="{{reviewUrl}}">{{title}}</a></p>
{{/order.items}}

Product

FieldTag
Name{{product.name}}
Image URL{{product.imageUrl}}

These describe the order's first item, the one {{order.reviewUrl}} links to.

Loyalty

FieldTag
Program name{{loyalty.programName}}
Points balance{{loyalty.points}}
Points earned{{loyalty.pointsEarned}}
Name for points{{loyalty.pointsName}}
Dashboard URL{{loyalty.dashboardUrl}}
Redeem URL{{loyalty.redeemUrl}}
Reward name{{loyalty.reward.name}}
Reward code{{loyalty.reward.code}}
Reward cost{{loyalty.reward.cost}}
Reward expiry{{loyalty.reward.expiresAt}}
Amount expiring{{loyalty.expiring.amount}}
Days until expiry{{loyalty.expiring.days}}
Expiry date{{loyalty.expiring.date}}
  • Points amounts arrive already written in your program's own words ("1,200 stars"), so don't add a unit after them. {{loyalty.pointsName}} is the plural name on its own, for "Spend your {{loyalty.pointsName}}".
  • {{loyalty.reward.name}} is the name of the rule the reward came from, as the member saw it. {{loyalty.reward.cost}} is what they spent, empty for a reward they didn't pay for.
  • The expiry fields are filled only on the two expiring emails: amount is what goes (points only), days counts whole days from now, date is the day in your store's time zone.
  • {{loyalty.dashboardUrl}} and {{loyalty.redeemUrl}} open the loyalty page you set under Settings → Loyalty, or your store's homepage if you set none. Both carry #cascade-rewards, which opens the loyalty widget on arrival. A shopper who isn't signed in sees what the program offers rather than their own balance, so put the member's numbers in the email itself.
{{#loyalty.reward.expiresAt}}
<p>Use it by {{loyalty.reward.expiresAt}}.</p>
{{/loyalty.reward.expiresAt}}

Wishlist

FieldTag
How many items{{wishlist.itemCount}}
First item name{{wishlist.item.name}}
First item price{{wishlist.item.price}}
First item link{{wishlist.item.url}}
Every item{{#wishlist.items}}

One alert covers everything that changed in the same pass, so loop over the items:

{{#wishlist.items}}
<p>
  {{name}}{{#variantName}} ({{variantName}}){{/variantName}}
  {{#previousPrice}}<s>{{previousPrice}}</s>{{/previousPrice}} {{price}}
  {{#dropPercent}}({{dropPercent}}% off){{/dropPercent}}
</p>
{{/wishlist.items}}
Per-item fieldTagWhat it holds
Name{{name}}The product's name.
Variant{{variantName}}The variant the customer saved, empty if they saved the product.
Image{{imageUrl}}The variant's image, falling back to the product's.
Link{{url}}The product's page on your storefront, empty if you store none.
Price{{price}}What it costs now, written out in its own currency.
Old price{{previousPrice}}What it cost before, on a price drop only.
Fall{{dropPercent}}How far it fell, in whole percent, on a price drop only.

{{wishlist.item}} is the first item, for a headline; {{wishlist.itemCount}} lets you write for one item or several. Prices are read when the email is sent, so an alert never quotes a price that has already moved again. A product saved without a variant is priced from its cheapest one.

Question

FieldTag
What was asked{{question.body}}
The answer{{question.answer}}
Who answered{{question.answerAuthor}}
Product name{{question.productName}}
Product link{{question.productUrl}}

{{question.answer}} is the answer your store wrote, even if a shopper answered first. {{question.productUrl}} carries #cascade-questions so it lands on the Q&A, and is empty for a product with no stored URL.

Layout components

Components are layout blocks written as Mustache sections with parameters in parentheses.

Row wraps content in a full-width table row; Column creates a column within it, with width controlling relative sizing:

{{#Row}} {{#Column}}(width="1")
<!-- left column -->
{{/Column}} {{#Column}}(width="1")
<!-- right column -->
{{/Column}} {{/Row}}

Button renders a styled call-to-action (href, backgroundColor, textColor, borderRadius in pixels):

{{#Button}}(href="https://example.com" backgroundColor="{{site.colors.primary}}" textColor="#FFFFFF"
borderRadius="6")Shop now{{/Button}}

Badge renders an inline label (bgcolor), and Callout a highlighted block (bgcolor, padding as a CSS value):

{{#Badge}}(bgcolor="#1BB05D")New{{/Badge}} {{#Callout}}(bgcolor="#F8F8FA" padding="24px 0")
<!-- callout content -->
{{/Callout}}

Preview placeholders

Templates normally hold their own copy. A template that leaves {{preheader}} or {{{body}}} as placeholders gets a Content section in the preview's settings popover to fill them in for the preview.