All Collections
Integrations
Magento Open Source and Adobe Commerce
Transactional email
Use variables in transactional email templates in Magento Open Source and Adobe Commerce
Use variables in transactional email templates in Magento Open Source and Adobe Commerce

Learn what variables you can use in your new account, order, shipping, invoice, and stock transactional email templates for Adobe Commerce.

Gareth Burroughes avatar
Written by Gareth Burroughes
Updated over a week ago

This reference document lists all the variables that are available for Adobe Commerce (previously Magento 2) transactional email campaigns. You can also use any Adobe Commerce 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.


Before you start

Things you need to know:

  • Using Dotdigital data fields in your Adobe Commerce transactional email template causes the send to fail because the sends are triggered directly from Adobe Commerce.

  • Since Adobe Commerce 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.

  • 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}}

Did this answer your question?