Learn what variables you can use in your new account, order, shipping, invoice, and stock transactional email templates for Magento.
Overview
This reference document lists all the variables that are available for Magento transactional email campaigns. You can also use any Magento variables in the subject line of your transactional email template. When building your transactional email templates, the variables must be inserted to merge the customer, order, and shipping information.
Donโt use Dotdigital data fields in your template
Using Dotdigital data fields in your Magento transactional email template causes the send to fail because the sends are triggered directly from Magento.
Since Magento is customisable, each environment can interpret the variables differently. It's strongly recommended to reach out to your agency for a detailed list of variables that you can use.
Limited support for variables
There's no guarantee the variables in this article will work in your unique environment. Support is limited and suggestions can only be provided to you. It's not possible to tell you which ones you should use, and because of this, your agency is the best resource to help answer these types of questions.
New account variables
The new account variables are:
Variable name | Variable |
---|---|
Customer name | {{var customer.name}} |
Store name | {{config path="general/store_information/name"}} |
Customer account URL | {{var this.getUrl($store, 'customer/account/')}} |
Forgot account password URL | {{this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token],_nosid:1])}} |
Customer email | {{var customer.email}} |
New order confirmation variables
The new order confirmation variables are:
Variable name | Variable |
---|---|
Customer name | {{var order_data.customer_name}} |
Store name | {{config path="general/store_information/name"}} |
Customer account URL | {{var this.getUrl($store, 'customer/account/')}} |
Order ID | {{var order.increment_id}} |
Order created/placed at |
{{var order.getCreatedAtFormatted(2)}} |
Order status |
{{var order_data.frontend_status_label}} |
If order notes | {{depend order.getEmailCustomerNote()}} {{/depend}} |
Order notes | {{var order.getEmailCustomerNote()|escape|nl2br}} |
Billing address | {{var formattedBillingAddress|raw}} |
Shipping address | {{var formattedShippingAddress|raw}} |
Payment method | {{var payment_html|raw}} |
Shipping method | {{var order.getShippingDescription()}} |
Order items | {{layout handle="sales_email_order_items" order=$order area="frontend"}} |
New shipment variables
The new shipment variables are:
Variable name | Variable |
---|---|
Customer name | {{var order_data.customer_name}} |
Store name | {{config path="general/store_information/name"}} |
Customer account URL | {{var this.getUrl($store, 'customer/account/')}} |
Order ID | {{var order.increment_id}} |
Order status | {{var order_data.frontend_status_label}} |
Shipment ID | {{var shipment.increment_id}} |
Shipment comment | {{var comment|escape|nl2br}} |
Shipping tracking details | {{block class='Magento\Framework\View\Element\Template' area='frontend'
template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment
order=$order}}
|
Billing address | {{var formattedBillingAddress|raw}} |
Shipping address | {{var formattedShippingAddress|raw}} |
Payment method | {{var payment_html|raw}} |
Shipping method | {{var order.getShippingDescription()}} |
Shipment items layout | {{layout handle="sales_email_order_shipment_items" shipment=$shipment
order=$order}} |
New invoice variables
The new invoice variables are:
Variable name | Variable |
---|---|
Customer name | {{var order_data.customer_name}} |
Store name | {{config path="general/store_information/name"}} |
Customer account URL | {{var this.getUrl($store, 'customer/account/')}} |
Order ID | {{var order.increment_id}} |
Order status | {{var order_data.frontend_status_label}} |
Invoice ID | {{var invoice.increment_id}} |
Invoice comments | {{var comment|escape|nl2br}} |
Billing address | {{var formattedBillingAddress|raw}} |
Shipping address | {{var formattedShippingAddress|raw}} |
Payment method | {{var payment_html|raw}} |
Shipping method | {{var order.getShippingDescription()}} |
Order invoice items layout | {{layout area="frontend" handle="sales_email_order_invoice_items"
invoice=$invoice order=$order}}
|
Product stock alert variables
The product stock alert variables are:
Variable name | Variable |
---|---|
Customer name | {{var customerName}} |
Store name | {{var alertGrid|raw}} |
Newsletter subscription confirmation variables
The newsletter subscription confirmation variables are:
Variable name | Variable |
---|---|
Default newsletter subscription confirmation | {{var subscriber_data.confirmation_link}} |