Email template variables and filters

Template variables

The email template uses the Liquid templating language. 

The email template has the following Liquid objects available:

  • product  - the product for the customer notification
  • variant  - the specific product variant the customer requested the notification for
  • shop  - your shop, including useful attributes such as  and
  • customer  - the customer the notification is being delivered to

Most of the popular Shopify Liquid filters have been made available for you to use in the customer email template. If you find a filter is missing please   contact support to see if it can be added.

If you're unfamiliar with Liquid templates take a look at  Shopify's Liquid introduction to learn the basics.



The name of shop.


The account owner email address for the shop.


The first line of the shop address.


The city for the shop address.


The zip or postal code for the shop address.


The country for the shop address.


The telephone number for the shop.


The state or province for the shop address.


The name of the shop account owner.


The domain name for the shop.



Returns the product id used in the store catalog.


Returns the product title.


Returns the handle used in the product page URL.


Returns the HTML content for the product description. Identical to product.description.


Returns the HTML content for the product description.


Return the product vendor.


Returns the type of product.


Returns a list of variants for the product. See variants below for more information.


Returns a list of images for the product.


Returns the featured image, or first image for the product.


Returns a list of product tags.


Returns the price for the product.


Returns a list of option names for the product.



Returns the variant's unique catalog id.           


Returns the variant's first option.


Returns the variant's second option.


Returns the variant's third option.


Returns the variant's price.


Returns the variant's compare at price.


Returns the variant's weight.


Returns the variant image if one has been set. Use the url property to include the image URL in your template.

{{ variant.image.url }}

To ensure an image is shown you can default to a product image if the variant image is blank:

{% assign featured_image = product.featured_image %}
{% if variant.image %}
  {% assign featured_image = variant.image %}
{% endif %}

<img src="{{ featured_image.url }}">

Returns the current inventory quantity for a variant.


Returns the SKU for the variant.


Returns the variant title.


Returns the variant title if set to something other than 'Default Title'. Otherwise it returns nothing.

This is useful when including a product and variant title, but you want to avoid single variant products being displayed as 'Default Title'.

/* Multi variant product, and variant title is 'Red' */
{{ product.title }} {{ variant.title_unless_default }} # Output: Shoes Red

/* Single variant product, and variant title is 'Default Title' so will be omitted */
{{ product.title }} {{ variant.title_unless_default }} # Output: Handbag

Returns a full URL to the product page, with the variant parameter and UTM parameters embedded. This is the easiest way to link to a product in your email template.

{{ variant.url}}
# Output:*|BISID|*&variant=665433569

If you would like to override the default UTM parameters you can construct a URL and include the analytics filter. See analytics filter below.


Returns a URL that will take the customer to the checkout page with the variant added to the cart. This reduces the steps required for the customer to select a variant and click 'add to cart'.

{{ variant.add_to_cart_url }}
# Output:*|UTMCAMPAIGN|*&utm_content=*|UTMCONTENT|*&bis_id=*|BISID|*

For a URL that links to the cart page instead of the checkout page, use the liquid expression below.

http://{{shop.domain}}/cart/add/{{ | analytics}}



The email address for the customer receiving the Back in Stock notification.


Link to unsubscribe customers from the notification / any registered notifications.

<a href="{{ customer.unsubscribe_url }}">Manage your notifications</a>

Link to unsubscribe from all notifications (one click unsubscribe). Some email clients, like Yahoo and Google, require this link to be present in the email.

<a href="{{ customer.unsubscribe_all_url }}">Unsubscribe from all notifications</a>

Template Filters

The standard Liquid filters are available for use. You can find a list of these in the Liquid  Standard Filters documentation. The following filters are available in addition to the standard filters.


Returns a URL for an file stored in the store's assets folder.

{{ 'logo.png' | asset_url }}

Takes a product image and returns a URL to that image. Accepts a Shopify image size name as a parameter.

{{ product.featured_image | product_img_url: "medium" }}

Available sizes are master, 2048x2048, 1024x1024, grande, large, medium, compact, small, thumb, icon, and pico.


Appends UTM parameters to a URL. This is normally used to construct a product URL.

http://{{shop.domain}}/products/{{ product.handle | analytics }}
# Output:

UTM parameters are useful for tracking click throughs and conversions in tools such as Google Analytics.

You can specify custom UTM parameters and still use the analytics filter. It will not override any existing parameters as long as you include the analytics filter last. 

For instance, to set a custom utm_campaign parameter:

http://{{shop.domain}}/products/{{ product.handle | append: '?utm_campaign=feb17' | analytics }}
# Output:

To change the default utm parameters it is necessary to change them manually (instead of use the analytics filter). For example, to replace utm_source=back-in-stock with utm_source=online-channel:

http://{{shop.domain}}/products/{{ product.handle | append: '?utm_source=online-channel&utm_medium=email&utm_campaign=*|UTMCAMPAIGN|*&utm_content=*|UTMCONTENT|*&bis_id=*|BISID|*' }}&variant={{ }}


Link to a product page instead of a variant

The default email template links to the product page using {{ variant.url }} . This builds a url with the variant= parameter in the URL to specify the specific variant.

If you would like to use a URL that simply links to the product page you can build one using the shop domain and product handle.
Add the following code to the top of the email template:
	{% capture product_url %}
	https://{{shop.domain}}/products/{{product.handle | analytics }}
	{% endcapture %}

This creates a variable called product_url with the required URL. You can then replace variant.url in the template with product_url .

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.