Difference between revisions of "Email Variable Reference dev"
From Spiffy Stores Knowledge Base
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Emails sent out from your shop are rendered using Liquid. Liquid is Spiffy Stores' simple, easy-to-use programming language. It's the same programming language that our themes are built on. | Emails sent out from your shop are rendered using Liquid. Liquid is Spiffy Stores' simple, easy-to-use programming language. It's the same programming language that our themes are built on. | ||
− | To edit your email templates, follow this tutorial. Here is a list of liquid email templates which you can | + | To edit your email templates, follow this tutorial. Here is a list of liquid email templates which you can customise from your shop admin: |
* Order Confirmation | * Order Confirmation | ||
Line 8: | Line 8: | ||
* Shipping Confirmation | * Shipping Confirmation | ||
* Shipping Update | * Shipping Update | ||
+ | * Draft Order | ||
+ | * Abandoned Order | ||
+ | * Gift Card | ||
All email templates in your admin have access to the properties of their corresponding order: | All email templates in your admin have access to the properties of their corresponding order: | ||
− | == In this article == | + | ==== In this article ==== |
− | |||
− | |||
− | |||
− | |||
− | |||
+ | * [[#Order variables|Order variables]] | ||
+ | * [[#Line_item properties|Line_item properties]] | ||
+ | * [[#Fulfillment properties|Fulfillment properties]] | ||
+ | * [[#Discounts in email templates|Discounts in email templates]] | ||
==Order variables== | ==Order variables== | ||
Line 26: | Line 28: | ||
The properties of an order are available in the following templates: | The properties of an order are available in the following templates: | ||
− | Order Confirmation | + | * Order Confirmation |
− | New Order Notification | + | * New Order Notification |
− | New Order Notification (mobile) | + | * New Order Notification (mobile) |
− | Shipping Confirmation | + | * Shipping Confirmation |
− | Shipping Update | + | * Shipping Update |
− | Additional Content & Scripts | + | * Additional Content & Scripts |
− | + | ||
− | Reminder | + | |
− | 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 }}. | + | ====Reminder==== |
− | id | + | 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 <pre>{{ order.shipping_method.title }}</pre> in, for example, your Order Confirmation email template, you would simply use <pre>{{ shipping_method.title }}</pre>. |
− | 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 | + | |
− | <a href="{{ shop.url }}/admin/orders/{{ id }}">View order</a> | + | |
− | email | + | <html> |
− | The email associated with the order. | + | <style type="text/css"> |
− | name | + | table.reference th { |
− | Typically this is a pound symbol followed by the order_number, e.g. Order #1004. | + | background-color: #FAFAFA; |
− | order_name | + | padding: 6px; |
− | Same as name. | + | text-align: left; |
− | order_number | + | vertical-align: top; |
− | 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 | + | font-family: Monaco,Consolas,"Lucida Console",monospace; |
− | created_at | + | font-size: 13px; |
− | 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. | + | color: #575757; |
− | transaction | + | width: 160px; |
− | tax_price | + | } |
− | Taxes of all the items in the order combined. | + | table.reference td { |
− | tax_lines | + | padding: 6px; |
− | 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 %} | + | </style> |
− | tax_line.title | + | </html> |
− | The name of the tax, e.g. | + | {| class="reference" |
− | tax_line.price | + | !id |
− | The amount. | + | |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 store. For example, in your New Order Notification template you would place: |
− | tax_line.rate | + | <pre><a href="{{ shop.url }}/admin/orders/{{ id }}">View order</a></pre> |
− | The rate. It will return 0.175 if it is 17.5%. | + | |- |
− | tax_line.rate_percentage | + | !email |
− | The tax rate in human readable form. It will return 17.5 if the rate is 0.175. | + | |The email associated with the order. |
− | customer | + | |- |
− | Customer object containing the attributes of the customer output. | + | !name |
− | billing_address | + | |Typically this is a pound symbol followed by the order_number, e.g. Order #1004. |
− | The billing address. | + | |- |
− | billing_address.first_name | + | !order_name |
− | First name of the customer. | + | |Same as name. |
− | billing_address.last_name | + | |- |
− | Last name of the customer. | + | !order_number |
− | billing_address.company | + | |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 Store owner in your store preferences. |
− | Company name for billing. | + | |- |
− | billing_address.phone | + | !created_at |
− | Phone number from the billing address. | + | |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. |
− | shop_name | + | transaction. |
− | Name of your store. | + | |- |
− | shop.phone | + | !tax_price |
− | Your store's phone number. | + | |Taxes of all the items in the order combined. |
− | subtotal_price | + | |- |
− | Subtotal of the order. | + | !tax_lines |
− | discounts_amount | + | |Taxes broken up by 'level' of taxation: |
− | Amount of the discount applied by all discounts (e.g. +$5.00). | + | <pre> |
− | discounts_savings | + | {% for tax_line in tax_lines %} |
− | Amount of the savings caused by all discounts (e.g. -$5.00). | + | {{ tax_line.title }} ({{ tax_line.rate_percentage }}%) : {{ tax_line.price | money_with_currency }} |
− | discounts | + | {% endfor %} |
− | A list of discounts. | + | </pre> |
− | total_price | + | |- |
− | Total of the order (subtotal + tax + shipping). | + | !tax_line.title |
− | financial_status | + | |The name of the tax, e.g. GST or VAT. |
− | The current payment status. One of: nil, 'pending', 'authorized', 'paid', 'voided', 'refunded'. | + | |- |
− | requires_shipping | + | !tax_line.price |
− | (boolean) Returns true if there is at least one item in the order that requires shipping. | + | |The amount. |
− | shipping_method.title | + | |- |
− | The Shipping rate name e.g. “Standard Shipping”. | + | !tax_line.rate |
− | shipping_method.price | + | |The rate. It will return 0.175 if it is 17.5%. |
− | Same as shipping_price below. | + | |- |
− | shipping_price | + | !tax_line.rate_percentage |
− | The shipping price. | + | |The tax rate in human readable form. It will return 17.5 if the rate is 0.175. |
− | Example: {{ shipping_price | money }} | + | |- |
− | shipping_address | + | !customer |
− | The shipping address. | + | |Customer object containing the attributes of the customer output. |
− | shipping_address.company | + | |- |
− | Company name for shipping address. | + | !billing_address |
− | shipping_address.company | + | |The billing address. |
− | Company name for shipping address. | + | |- |
− | shipping_address.phone | + | !billing_address.first_name |
− | Phone number from the shipping address. | + | |First name of the customer. |
− | line_items | + | |- |
− | List of all Line Items in the order. | + | !billing_address.last_name |
− | item_count | + | |Last name of the customer. |
− | A sum of all the items' quantities. | + | |- |
− | fulfillment_status | + | !billing_address.company |
− | The current fulfillment status of the order. One of: 'unfulfilled', 'partial', 'fulfilled'. | + | |Company name for billing. |
− | 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. | + | !billing_address.phone |
− | attributes | + | |Phone number from the billing address. |
− | Any attributes which were attached to the order. | + | |- |
− | Example: {{ attributes.gift-note }} | + | !shop_name |
− | referring_site | + | |Name of your store. |
− | Contains the url of the referrer that brought the customer to your store. | + | |- |
− | Example: http://www.google.com/?s=great+products | + | !shop.phone |
− | landing_site | + | |Your store's phone number. |
− | 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. | + | |- |
+ | !subtotal_price | ||
+ | |Subtotal of the order. | ||
+ | |- | ||
+ | !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). | ||
+ | |- | ||
+ | !discounts | ||
+ | |A list of discounts. | ||
+ | |- | ||
+ | !total_price | ||
+ | |Total of the order (subtotal + tax + shipping). | ||
+ | |- | ||
+ | !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: <pre>{{ shipping_price | money }}</pre> | ||
+ | |- | ||
+ | !shipping_address | ||
+ | |The shipping address. | ||
+ | |- | ||
+ | !shipping_address.company | ||
+ | |Company name for 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: <pre>{{ attributes.gift-note }}</pre> | ||
+ | |- | ||
+ | !referring_site | ||
+ | |Contains the url of the referrer that brought the customer to your store. | ||
+ | Example: <pre>http://www.google.com/?s=great+products</pre> | ||
+ | |- | ||
+ | !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 | 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. | + | !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 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: | ||
+ | <pre> | ||
{% if landing_site_ref == 'my-tracking-token' %} | {% if landing_site_ref == 'my-tracking-token' %} | ||
My action... | My action... | ||
{% endif %} | {% endif %} | ||
− | cancelled | + | </pre> |
− | (boolean) Returns true if the order has been cancelled. | + | |- |
− | cancelled_at | + | !cancelled |
− | The time when the order was cancelled. | + | |(boolean) Returns true if the order has been cancelled. |
− | cancel_reason | + | |- |
− | The reason selected when cancelling the order. One of: 'inventory', 'customer', 'fraud', 'other'. | + | !cancelled_at |
− | has_high_risks? | + | |The time when the order was cancelled. |
− | Returns true if the order has high risk | + | |- |
− | unique_gateways | + | !cancel_reason |
− | Returns a list of unique payments gateways on an order | + | |The reason selected when cancelling 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. | |
− | + | |} | |
==Line_item properties== | ==Line_item properties== | ||
Line 152: | Line 220: | ||
Each line in the list of line_items has the following properties. See the default templates for example usage. | Each line in the list of line_items has the following properties. See the default templates for example usage. | ||
− | line.title | + | <html> |
− | 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”. | + | <style type="text/css"> |
− | line.price | + | table.reference th { |
− | The price for a single item. | + | background-color: #FAFAFA; |
− | line.quantity | + | padding: 6px; |
− | Quantity for that item. | + | text-align: left; |
− | line.line_price | + | vertical-align: top; |
− | The price multiplied by the quantity for that item. | + | font-family: Monaco,Consolas,"Lucida Console",monospace; |
− | line.sku | + | font-size: 13px; |
− | SKU of the product. | + | color: #575757; |
− | line.grams | + | width: 131px; |
− | Weight of a single item. | + | } |
− | line.vendor | + | table.reference td { |
− | Vendor for the item. | + | padding: 6px; |
− | line.requires_shipping | + | } |
− | (boolean) Returns true if the variant for the item has the checkbox 'Require a shipping address' checked on the product page. | + | </style> |
− | line.taxable | + | </html> |
− | (boolean) Returns true if the variant for the item has the checkbox 'Charge taxes on this product' checked on the product page. | + | {| class="reference" |
− | + | !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.price | ||
+ | |The price for a single item. | ||
+ | |- | ||
+ | !line.quantity | ||
+ | |Quantity for that item. | ||
+ | |- | ||
+ | !line.line_price | ||
+ | |The price multiplied by the quantity for that item. | ||
+ | |- | ||
+ | !line.sku | ||
+ | |SKU of the product. | ||
+ | |- | ||
+ | !line.grams | ||
+ | |Weight of a single item. | ||
+ | |- | ||
+ | !line.vendor | ||
+ | |Vendor for the item. | ||
+ | |- | ||
+ | !line.requires_shipping | ||
+ | |(boolean) Returns true if the variant for the item has the checkbox 'Require a shipping address' checked on the product page. | ||
+ | |- | ||
+ | !line.taxable | ||
+ | |(boolean) Returns true if the variant for the item has the checkbox 'Charge taxes on this product' checked on the product page. | ||
+ | |} | ||
==Fulfillment properties== | ==Fulfillment properties== | ||
− | These additional properties are available on the Shipping Confirmation | + | These additional properties are available on the Shipping Confirmation and Shipping Update 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 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. | ||
− | + | <html> | |
− | + | <style type="text/css"> | |
− | + | table.reference th { | |
− | + | background-color: #FAFAFA; | |
− | fulfillment.fulfillment_line_items | + | padding: 6px; |
− | A list of Fulfillment_line_items to be fulfilled. | + | text-align: left; |
− | fulfillment.item_count | + | vertical-align: top; |
− | A sum of all the items' quantities. The total number of items being fulfilled. | + | font-family: Monaco,Consolas,"Lucida Console",monospace; |
− | fulfillment.tracking_company | + | font-size: 13px; |
− | The company doing the tracking. | + | color: #575757; |
− | fulfillment.tracking_numbers | + | width: 131px; |
− | A list of tracking numbers. | + | } |
− | fulfillment.tracking_urls | + | table.reference td { |
− | A list of tracking URLs. | + | padding: 6px; |
− | fulfillment.requires_shipping | + | } |
− | (boolean) Returns true if this fulfillment request requires shipping. | + | </style> |
− | + | </html> | |
− | + | {| class="reference" | |
− | + | !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. | ||
+ | |} | ||
==Discounts in email templates== | ==Discounts in email templates== | ||
Line 224: | Line 324: | ||
<html> | <html> | ||
− | + | <style type="text/css"> | |
− | + | table.reference th { | |
− | + | background-color: #FAFAFA; | |
+ | padding: 6px; | ||
+ | text-align: left; | ||
+ | vertical-align: top; | ||
+ | font-family: Monaco,Consolas,"Lucida Console",monospace; | ||
+ | font-size: 13px; | ||
+ | color: #575757; | ||
+ | width: 131px; | ||
+ | } | ||
+ | table.reference td { | ||
+ | padding: 6px; | ||
+ | } | ||
+ | </style> | ||
</html> | </html> | ||
{| class="reference" | {| class="reference" | ||
− | ! | + | !title |
− | | | + | |The name of this discount. |
|- | |- | ||
− | ! | + | !code |
− | | | + | |The code the customer has to input to apply for this discount. |
+ | |- | ||
+ | !amount | ||
+ | |Amount of the savings this discount causes (usually same as discounts_amount, because there is only one discount object). | ||
+ | |- | ||
+ | !savings | ||
+ | |Amount of the discount this discount applies (usually same as discounts_savings, because there is only one discount object). | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 10:37, 28 October 2022
Emails sent out from your shop are rendered using Liquid. Liquid is Spiffy Stores' simple, easy-to-use programming language. It's the same programming language that our themes are built on.
To edit your email templates, follow this tutorial. Here is a list of liquid email templates which you can customise from your shop admin:
- Order Confirmation
- New Order Notification
- New Order Notification (mobile)
- Shipping Confirmation
- Shipping Update
- Draft Order
- Abandoned Order
- Gift Card
All email templates in your admin have access to the properties of their corresponding order:
Contents
In this article
Order variables
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 Notification
- New Order Notification (mobile)
- Shipping Confirmation
- Shipping Update
- Additional Content & Scripts
Reminder
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 }}
.
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 store. For example, in your New Order Notification template you would place:
<a href="{{ shop.url }}/admin/orders/{{ id }}">View order</a> |
---|---|
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 Store owner in your store 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. |
tax_price | 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. GST 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 | Subtotal of the order. |
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). |
discounts | A list of discounts. |
total_price | Total of the order (subtotal + tax + shipping). |
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.company | Company name for 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: http://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 cancelled. |
cancelled_at | The time when the order was cancelled. |
cancel_reason | The reason selected when cancelling 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. |
Line_item properties
Each line in the list of line_items has the following properties. See the default templates for example usage.
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.price | The price for a single item. |
line.quantity | Quantity for that item. |
line.line_price | The price multiplied by the quantity for that item. |
line.sku | SKU of the product. |
line.grams | Weight of a single item. |
line.vendor | Vendor for the item. |
line.requires_shipping | (boolean) Returns true if the variant for the item has the checkbox 'Require a shipping address' checked on the product page. |
line.taxable | (boolean) Returns true if the variant for the item has the checkbox 'Charge taxes on this product' checked on the product page. |
Fulfillment properties
These additional properties are available on the Shipping Confirmation and Shipping Update 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.
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. |
Discounts in email templates
discounts
is a list of discounts applied to the order. Currently, there can only be one discount so this list contains only 1 element, but it may be possible to apply many discount codes to the same order in the future.
You can retrieve the discount object from the list with:
{% assign discount = discounts.first %}
To show the discount code and amount applied to the order, you'll use:
{% if discounts %}Discounts ({{ discounts.first.code }}) : {{ discounts_savings | money_with_currency }}{% endif %}
Each
discount
element has the following Liquid properties:
title | The name of this discount. |
---|---|
code | The code the customer has to input to apply for this discount. |
amount | Amount of the savings this discount causes (usually same as discounts_amount, because there is only one discount object). |
savings | Amount of the discount this discount applies (usually same as discounts_savings, because there is only one discount object). |