Email Templates: Template Variables

Template Variables

Variables are the shortcuts you insert into an email template, written in square brackets like [STORE_NAME], or [ORDER_NUMBER], and which are replaced with real values when the email is sent. You write the template once; each customer gets their own details filled in.

How they work

You type a variable into the template (or insert it from the menu), and when the store sends the email, each of them is replaced with the actual value for that customer and that order. This is how [CODE], becomes the customer's real login code, [TOTAL_INC_VAT], becomes their actual total amount, and so on.

In the editor's preview, the variables show example values, so you get an impression of what the finished email will look like. The real values only appear in the email that lands in the customer's inbox.

Insert a variable

Open the template in the editor and use the button Use variable (the menu Template Variables). Search for the one you want and click on it to insert it into the block you are editing. You can also type the bracketed name manually if you know it.

Which variables are available depends on the template. An order confirmation offers order and amount variables; the one-time login code email offers the login code; account emails offer customer details. The menu only shows what the current template can actually fill in, so you cannot accidentally insert one that doesn't work.

Amount variables for orders

Order confirmations (the standard confirmation, the pickup variant, and the B2B variant) can display the monetary amounts in the order. Each amount is available in two versions, one with VAT and one without, so you can display what suits your customers:

Variable

Shows

[TOTAL_INC_VAT]

The total sum for the order, incl. VAT.

[TOTAL_EX_VAT]

The total sum for the order, excl. VAT.

[SUBTOTAL_INC_VAT]

The subtotal for the products, incl. VAT.

[SUBTOTAL_EX_VAT]

The subtotal for the products, excl. VAT.

[SHIPPING_INC_VAT]

The shipping cost, incl. VAT.

[SHIPPING_EX_VAT]

The shipping cost, excl. VAT.

[VAT]

Total VAT for the entire order.

A couple of things worth knowing:

  • Amounts follow the order's currency. Each value is displayed in the currency the customer actually paid in, and is formatted in the same way as in the checkout, so that the email matches what they saw when they ordered.
  • [VAT] covers the entire order. It is the total VAT across products, shipping, and any fees — the same VAT amount displayed in the checkout. (If you've seen this number look a bit low in older emails, it has been corrected; it now includes shipping VAT, not just product VAT.)
  • Choose with or without VAT according to your target audience. Stores selling to consumers usually show amounts incl. VAT; stores selling to businesses often prefer excl. VAT. The B2B confirmation template therefore uses the versions without VAT by default.

Avoid [SUBTOTAL]

There is an older variable, [SUBTOTAL], which is now marked as deprecated in the menu. Despite its name, it does not show the product subtotal — it shows the total sum incl. VAT, an old quirk we have only kept so that old templates do not stop working. For anything new, you should use [TOTAL_INC_VAT], if you want the total sum, or [SUBTOTAL_INC_VAT][SUBTOTAL_EX_VAT], if you want the product subtotal.

Variables found everywhere

Most templates, regardless of type, offer these basics:

Variable

Becomes

[CUSTOMER_NAME] (plus first name / last name)

Customer's name, when known.

[STORE_NAME]

Your store name.

[STORE_LOGO]

Your store's logo image.

[URL]

A link to your store.

Store contact details

Address, postal code, organization number, and email.

Order confirmations add order-specific variables at the top — order number, date, payment and shipping method, product list, tracking, and the amounts above. The one-time code email adds [CODE]. The menu is the reliable list for the template you are editing.

Tips

  • Let the menu be your guide. It only lists variables that template can fill, so if something isn't there, that template cannot deliver it.
  • Check the preview. The editor's preview inserts example values, which is the fastest way to confirm you used the correct variable before publishing.
  • Customize the VAT display for your customers. Consumer stores rely on amounts including VAT; business-oriented confirmations usually show excluding VAT.
  • Do not resort to [SUBTOTAL] in new templates. It is a total sum, not a subtotal. Use the clearly named variables instead.

All variables

The full set of variables the editor can insert, and which templates offer each of them. The menu Use variable inside a template is always the definitive list for that specific template — this is the cross-template reference for what exists. "Most templates" means all except the two specialized order emails (Order Files and Partial Delivery).

Show the full variable list

Customer and store basics

VariableWhat it insertsAvailable in
[CUSTOMER_NAME]Customer's nameAll templates
[CUSTOMER_FIRST_NAME]Customer's first nameAll templates
[CUSTOMER_LAST_NAME]Customer's last nameAll templates
[CUSTOMER_EMAIL]Customer's email addressMost templates
[STORE_NAME]Your store nameMost templates
[STORE_LOGO]Your store logoAll templates
[STORE_NAME_ADDRESS]Your store's addressMost templates
[STORE_CITY]Your store's cityMost templates
[REGISTRATION_NUMBER]Your organisation numberMost templates
[EMAIL]Your store's email addressMost templates
[URL]Link to your storeMost templates

Account and login

VariableWhat it insertsAvailable in
[CODE]The one-time login codeOne-Time Password
[CUSTOMER_PASSWORD]Customer's passwordNew Customer, Forgotten Password
[CUSTOMER_IP_ADDRESS]Customer's IP addressForgotten Password

Order details

VariableWhat it insertsAvailable in
[ORDER_NUMBER]Order numberOrder confirmation, Order status, Order Files, Partial Delivery
[ORDER]Order number (alternate)Partial Delivery
[ORDER_URL]Link to the order in the customer's accountOrder confirmation
[DATE]Order dateOrder confirmation
[ORDER_DATE]Order dateOrder status
[STATUS]Order statusOrder status, Partial Delivery
[STORE_NAME_PHONE]Your store's phone numberOrder confirmation
[STORE_PHONE]Your store's phone numberPartial Delivery
[STORE_EMAIL]Your store's email addressPartial Delivery
[CUSTOMER_PHONE]Customer's phoneOrder confirmation, Order status
[CUSTOMER_DELIVERY_ADDRESS]Customer's delivery addressOrder confirmation, Order status
[CUSTOMER_BILLING_ADDRESS]Customer's invoice addressOrder confirmation
[CUSTOMER_DELIVERY_DISTRICT]Customer's delivery districtOrder confirmation
[CUSTOMER_BIRTH_DATE]Customer's date of birthOrder status
[PAYMENT_METHOD]Payment methodOrder confirmation
[SHIPPING_METHOD]Shipping methodOrder confirmation
[PRODUCTS_ORDERED]The list of ordered productsOrder confirmation
[PRODUCTS_ORDERED_TR]Ordered products as table rowsOrder confirmation
[PRODUCT_NAME]Ordered product namePartial Delivery
[PRODUCT_QUANTITY]Ordered product quantityPartial Delivery
[DATE_AVAILABLE]Expected delivery datePartial Delivery
[CURRENCY]The order's currency code (e.g. NOK)Order confirmation
[COMMENT]Comment on the orderOrder confirmation, Order status
[REFERENCE]Order referenceOrder confirmation
[GIFT_CARD]Gift card detailsOrder confirmation
[DIGITAL_PRODUCT]Digital product download linksOrder confirmation
[ORDER_BONUS_POINTS]Bonus points earned on the orderOrder confirmation
[ORDER_RECURRING_LINES]Recurring order linesOrder confirmation
[ORDER_SHIPPING_COST]Shipping cost (recurring orders)Order confirmation
[FIXED_PAYMENT]Fixed payment feeOrder confirmation
[ORDER_CONFIRMATION_PDF]Order confirmation PDF attachmentOrder confirmation
[ATTACHMENTS]List of attachment download linksOrder Files
[TIMESTAMP]Unix epoch timeOrder confirmation

Order amounts

VariableWhat it insertsAvailable in
[TOTAL_INC_VAT]Order total, including VATOrder confirmation
[TOTAL_EX_VAT]Order total, excluding VATOrder confirmation
[SUBTOTAL_INC_VAT]Products subtotal, including VATOrder confirmation
[SUBTOTAL_EX_VAT]Products subtotal, excluding VATOrder confirmation
[SHIPPING_INC_VAT]Shipping cost, including VATOrder confirmation
[SHIPPING_EX_VAT]Shipping cost, excluding VATOrder confirmation
[VAT]Total VAT for the whole orderOrder confirmation
[SHIPPING]Shipping cost (sums all shipping lines)Order confirmation
[SUBTOTAL]Deprecated — returns the grand total incl. VAT. Use [TOTAL_INC_VAT].Order confirmation

Delivery updates and tracking

VariableWhat it insertsAvailable in
[TRACKING_NUMBER]Tracking number with a full clickable linkOrder status
[TRACKING_NUMBER_RAW]Tracking number (number only)Order status
[TRACKING_NUMBER_URL]Tracking URL onlyOrder status
[TRACKING_NUMBER_NO]Tracking number (number only)Order status

Conditional sections (advanced)

These don't insert a value. They wrap part of your template so it only shows when the condition is true — for example, only showing a comment block when the order actually has a comment.

VariableShows its contents when…Available in
[COMMENT]The order has a commentOrder confirmation, Order status
[REFERENCE]The order has a referenceOrder confirmation
[GIFT_CARD]A gift card was usedOrder confirmation
[DIGITAL_PRODUCT]The order has digital productsOrder confirmation
[ORDER_BONUS_POINTS]The order earned bonus pointsOrder confirmation
[ORDER_RECURRING]The order is a recurring orderOrder confirmation
[INVOICE]The order is paid by invoiceOrder confirmation, Order status
[CANCELLATION]A Right to regret form appliesOrder confirmation, Order status
[INVOICE_CANCELLATION]Invoice and Right to regret both applyOrder confirmation, Order status
[REMINDER]The email is a reminderOrder confirmation, Order status
[TRACKING_NUMBER]The order has a tracking numberOrder status
[LIMITED]Downloads are limitedOrder Files
[ORDER_LOOP]Repeats its contents once per ordered productPartial Delivery
[PRODUCT_TEMPLATE]Marks the layout used for each product in the loopPartial Delivery
[DATE_AVAILABLE]The product has an expected delivery datePartial Delivery