Email variables reference

Emails sent out from your shop are rendered using Liquid. Liquid is Shopify's simple, easy-to-use programming language. It's the same programming language that our themes from the Theme Store are built on.

To edit your email templates, follow this tutorial. Here is a list of liquid email templates which you can customize from your shop admin:

  • Abandoned checkout
  • Contact customer
  • Customer account invite
  • Customer account welcome
  • Customer account password reset
  • Draft order invoice
  • Fulfillment request
  • Gift card created
  • New order
  • New order (mobile)
  • Order canceled
  • Order confirmation
  • POS and mobile receipt
  • Order refund
  • Shipping confirmation
  • Shipping update

All email templates in your admin have access to the properties of their corresponding order:

Order properties

Many properties of an order are available directly using Liquid, in email templates and in Additional Content & Scripts.

The properties of an order are available in the following templates:

  • Order confirmation
  • New order
  • New order (mobile)
  • Shipping confirmation
  • Shipping update
  • Additional Content & Scripts
  • Fulfillment request

Note

Unlike most other Liquid objects, the order object itself is not referenced by name in any of the email templates or in Additional Content & Scripts. So instead of using {{ order.shipping_method.title }} in, for example, your Order confirmation email template, you would simply use {{ shipping_method.title }}.

Property Description
id

A system wide unique ID of the order for internal use. Use this e.g. to generate a link to the order in the admin section of your shop. For example, in your **New order** template you would place:

<a href="{{ shop.url }}/admin/orders/{{ id }}">View order</a>

email
The email associated with the order.
name
Typically this is a pound symbol followed by the order_number, e.g. Order #1004.
order_name
Same as name.
order_number
Shop unique number of the order, e.g. 1004, without the pound # prefix, or any prefix or suffix added to the order ID by the shop-owner in his shop preferences.
created_at
The date and time the customer created the order, e.g. 2009-05-30T17:43:51+02:00. You can format this using the date filter.
transaction Notifications have access to every transaction property. Please see our Transaction API documentation here for a full list of the properties.
total_tax
Taxes of all the items in the order combined.
tax_lines

Taxes broken up by 'level' of taxation:

{% for tax_line in tax_lines %} {{ tax_line.title }} ({{ tax_line.rate_percentage }}%) : {{ tax_line.price | money_with_currency }} {% endfor %}

tax_line.title
The name of the tax, e.g. QST or VAT.
tax_line.price
The amount.
tax_line.rate
The rate. It will return 0.175 if it is 17.5%.
tax_line.rate_percentage
The tax rate in human readable form. It will return 17.5 if the rate is 0.175.
customer
Customer object containing the attributes of the customer output.
billing_address
The billing address.
billing_address.first_name
First name of the customer.
billing_address.last_name
Last name of the customer.
billing_address.company
Company name for billing.
billing_address.phone
Phone number from the billing address.
shop.name
Name of your store.
shop.phone
Your store's phone number.
subtotal_price
Sum of the order's line-item prices after any line-item discount or cart discount has been deducted. The subtotal doesn't include taxes (unless taxes are included in the prices) or shipping costs.
discounts
A list of discounts.
discounts_amount
Amount of the discount applied by all discounts (e.g. +$5.00).
discounts_savings
Amount of the savings caused by all discounts (e.g. -$5.00).
total_price

Total of the order (subtotal + shipping cost - shipping discount + tax).

financial_status
The current payment status. One of: nil, 'pending', 'authorized', 'paid', 'voided', 'refunded'.
requires_shipping
(boolean) Returns true if there is at least one item in the order that requires shipping.
shipping_method.title
The Shipping rate name e.g. “Standard Shipping”.
shipping_method.price
Same as shipping_price below.
shipping_price

The shipping price.

Example: {{ shipping_price | money }}

shipping_address
The shipping address.
shipping_address.first_name
The first name for the shipping address.
shipping_address.company
Company name for shipping address.
shipping_address.phone
Phone number from the shipping address.
line_items
List of all Line Items in the order.
item_count
A sum of all the items' quantities.
fulfillment_status
The current fulfillment status of the order. One of: 'unfulfilled', 'partial', 'fulfilled'.
note
The note which is attached to the order. The note can be obtained from the customer and/or edited in the order detail screen in your admin interface.
attributes

Any attributes which were attached to the order.

Example: {{ attributes.gift-note }}

referring_site

Contains the url of the referrer that brought the customer to your store.

Example: https://www.google.com/?s=great+products

landing_site

Contains the path of the landing site the customer used. This is the first page that the customer saw when he/she reached the store.

Example: /products/great-product?ref=my-tracking-token

landing_site_ref

Looks at the landing site and extracts a reference parameter from it. Reference parameters can be: ref, source, r.

If the landing_site was /products/great-product?ref=my-tracking-token, then the landing_site_ref will be my-tracking-token. You can accomplish a certain action if your ref is equal to a certain value:

{% if landing_site_ref == 'my-tracking-token' %}
My action...
{% endif %}

cancelled
(boolean) Returns true if the order has been canceled.
cancelled_at
The time when the order was canceled.
cancel_reason
The reason selected when canceling the order. One of: 'inventory', 'customer', 'fraud', 'other'.
has_high_risks?

Returns true if the order has high risk

unique_gateways

Returns a list of unique payments gateways on an order. For example, if someone paid with a Visa, a MasterCard, and cash, the returned list would be "shopify_payments, cash".

location (POS only)

Displays the physical location of the order. There are several location properties available, listed here. You can configure locations in the Locations area of the admin.

order_status_url

Returns the link to the order status page for this order.

fulfilled_line_items (deprecated)
List of Line Items which have been fulfilled.
unfulfilled_line_items (deprecated)
List of Line Items which have not been fully fulfilled.

Draft order properties

Draft order properties are available on the Draft Order Invoice email template, which notifies your customers about outstanding invoices.

Property Description
id
A unique ID of the draft order for internal use.
invoice_url
A link the customer can follow to pay for the invoice using Shopify's secure checkout.
reserve_inventory_until

The date and time the line items in the draft are reserved until, for example, 2015-05-30T17:43:51+02:00.

You can format dates using the Liquid date filter.

user
The last staff member who modified the draft order.
user.name
The name of the last staff member who modified the draft order.
user.email
The email address of the last staff member who modified the draft order.
email
The email address associated with the draft order.
name
The unique number of the draft order, prefixed by a number sign #.
number
The unique number of the draft order without the order prefix or suffix.
created_at

The date and time the customer created the draft order, for example, 2009-05-30T17:43:51+02:00.

You can format dates using the Liquid date filter.

total_tax
The combined tax amount for all items in the draft order.
tax_lines

Taxes broken up by 'level' of taxation:

{% for tax_line in tax_lines %}
{{ tax_line.title }} ({{ tax_line.rate_percentage }}%) : {{ tax_line.price | money_with_currency  }}
{% endfor %}
tax_line.title
The name of the tax, for example, QST or VAT.
tax_line.price
The tax amount.
tax_line.rate
The tax rate in decimal form. For example, a tax rate of 17.5% will return 0.175.
tax_line.rate_percentage
The tax rate in percentage form. For example, a rate of 0.175 will return 17.5.
customer
Customer object containing the attributes of the customer output.
billing_address
The billing address for the draft order.
billing_address.first_name
The customer's first name.
billing_address.last_name
The customer's last name.
billing_address.company
The company name in the billing address.
billing_address.phone
The phone number in the billing address.
shop.name
The name of your store.
shop.phone
Your store's phone number.
subtotal_price
Sum of the draft order's line-item prices after any line-item discount or cart discount has been deducted. The subtotal doesn't include taxes (unless taxes are included in the prices) or shipping costs.
discounts
A list of discounts.
discounts_amount
Amount of the discount applied by all discounts (e.g. +$5.00).
discounts_savings
Amount of the savings caused by all discounts (e.g. -$5.00).
total_price
The total price of the order (subtotal + shipping cost - shipping discount + tax).
requires_shipping
Returns true if there is at least one item in the draft order that requires shipping. Returns false if no items in the draft order require shipping.
shipping_method.title
The shipping rate name, for example, Standard Shipping.
shipping_method.price
The price of the shipping method. Returns the same information as shipping_price.
shipping_price

The shipping price.

You can format this amount using Liquid money filters.

shipping_address

The shipping address.

Note: Unlike in regular orders, a draft order's shipping address may be incomplete.

shipping_address.first_name
The first name for the shipping address.
shipping_address.company
The company name in the shipping address.
shipping_address.phone
The phone number in the shipping address.
line_items
A list of all line items in the draft order.
item_count
A sum of all the item quantities in the draft order.
note
The note attached to the draft order. The note can be obtained from the customer and also edited in the draft order detail screen in your Shopify admin.
location

The physical location of the order. There are several location properties available.

You can configure locations in the Locations page of your Shopify admin.

Line item properties

Each line in the list of line_items has the following properties:

Property Description
line.applied_discounts (POS and draft orders only)
List of discounts applied to this item (each discount has the title, code, amount, savings and type properties).
line.custom (Draft orders only)
(boolean) Returns true if the item is a custom line item for a draft order.
line.grams
Weight of a single item.
line.image
Returns the URL of the image associated with this line item. You can also use the img_url filter to get specific image sizes, for example {{ line.image | img_url: 'small' }}
line.line_price
The price multiplied by the quantity for that item.
line.price
The price for a single item.
line.quantity
Quantity for that item.
line.requires_shipping
(boolean) Returns true if the variant for the item has the checkbox **Requires shipping** checked on the product page.
line.sku
SKU associated with the product.
line.taxable
(boolean) Returns true if the variant for the item has the checkbox 'Charge taxes on this product' checked on the product page.
line.title
The name of the product followed by a dash followed by the name of the variant. The variant name is not included when it is “Default Title”.
line.variant.barcode
Barcode associated with the product.
line.product.vendor
Vendor for the item.

Refunds properties

These additional properties are available on the Refunds email template. This email template is used to notify your customers that a refund (complete or partial) has been applied to their order. You can use any variable available for the Order email notification template, in addition to the following variables:

Property Description
amount
The amount of money refunded.
refund_line_items
A list of Refund_line_items to be refunded.

Refund_line_item properties

Each refund_line in the list of refund_line_items has the following properties:

Property Description
refund_line.line_item
The line_item that is being refunded. This has access to all the line_item’s properties.
refund_line.quantity
The quantity of the line item to be refunded.

Default refund email template

  {% if customer.name %}Dear {{ customer.name }},{% endif %}

  {{ shop.name }} has refunded your order ({{ name }}){% if amount > 0 %} a total of {{ amount | money_with_currency }}{% endif %}{% if refund_line_items.size > 0 %} for:
  % for line in refund_line_items %}{{ line.quantity }}x {{ line.line_item.title }}
  {% endfor %}
{% else %}.{% endif %}

Fulfillment properties

These additional properties are available on the Shipping confirmation, Shipping update and Fulfillment request email templates.

The Shipping confirmation and Shipping update are used to notify your customers that some or all items in their order have been successfully fulfilled, or updated with new shipping information.

The Fulfillment request email template is used for any custom fulfillment service defined in your shop admin. To add a custom fulfillment service, go to the Settings > Shipping pages and scroll down to the "Fulfillment/Dropshipping" section.

Property Description
service_name
The name of the custom service as defined in the Settings > Shipping page. (Fulfillment request only)
fulfillment.fulfillment_line_items
A list of Fulfillment_line_items to be fulfilled.
fulfillment.item_count
A sum of all the items' quantities. The total number of items being fulfilled.
fulfillment.tracking_company
The company doing the tracking.
fulfillment.tracking_numbers
A list of tracking numbers.
fulfillment.tracking_urls
A list of tracking URLs.
fulfillment.requires_shipping
(boolean) Returns true if this fulfillment request requires shipping.
items_to_fulfill (deprecated)
List of Line Items that are to be fulfilled by this particular Custom fulfillment service. (Fulfillment request only)
items_to_fulfill_count (deprecated)
The total number of items to be fulfilled by this request. (Fulfillment request only)

Fulfillment_line_item properties

Each fulfillment_line in the list of fulfillment_line_items has the following properties.

Property Description
fulfillment_line.line_item
The line_item being fulfilled. This has access to all the line_item's properties.
fulfillment_line.quantity
The quantity of the line item that is being fulfilled.

Discount properties

Property Description
discount.code
The code the customer inputs to apply the discount.
discount.amount
The amount discounted from the order total.
discount.savings
The amount of money saved by the customer because of the discount code.
discount.type
The type of discount (FixedAmountDiscount, PercentageDiscount, or ShippingDiscount).

Want to discuss this page?

Visit the Shopify Community

Ready to start selling online with Shopify?

Try it free