A Complete List of Default Variables Used in Magento 2 Email Templates
You may want to bookmark this post for future reference as it has the complete list of default variables used in Magento 2 Email templates.
Magento 2 has this excellent functionality to send various Emails to customers at each stage of the shopping cycle. Email customization and Email template is an important topic for any online shop.
As a developer, you may not remember every default variable used in Email templates in Magento 2. Hence the below list might prove helpful.
List of Default Variables Used in Magento 2 Email Templates: |
|
---|---|
Default Variable Description | Magento 2 Default Variable |
Email Footer Template | {{template config_path=”design/email/footer_template”}} |
Email Header Template | {{template config_path=”design/email/header_template”}} |
Email Logo Image Alt | {{var logo_alt}} |
Email Logo Image URL | {{var logo_url}} |
Email Logo Image Height | {{var logo_height}} |
Email Logo Image Width | {{var logo_width}} |
Template CSS | {{var template_styles|raw}} |
Base Unsecure URL | {{config path=”web/unsecure/base_url”}} |
Base Secure URL | {{config path=”web/secure/base_url”}} |
General Contact Name | {{config path=”trans_email/ident_general/name”}} |
Sales Representative Contact Name | {{config path=”trans_email/ident_sales/name”}} |
Sales Representative Contact Email | {{config path=”trans_email/ident_sales/email”}} |
Custom1 Contact Name | {{config path=”trans_email/ident_custom1/name”}} |
Custom1 Contact Email | {{config path=”trans_email/ident_custom1/email”}} |
Custom2 Contact Name | {{config path=”trans_email/ident_custom2/name”}} |
Custom2 Contact Email | {{config path=”trans_email/ident_custom2/email”}} |
Store Name | {{config path=”general/store_information/name”}} |
Store Phone Number | {{config path=”general/store_information/phone”}} |
Store Hours | {{config path=”general/store_information/hours”}} |
Country | {{config path=”general/store_information/country_id”}} |
Region/State | {{config path=”general/store_information/region_id”}} |
Zip/Postal Code | {{config path=”general/store_information/postcode”}} |
City | {{config path=”general/store_information/city”}} |
Street Address 1 | {{config path=”general/store_information/street_line1″}} |
Street Address 2 | {{config path=”general/store_information/street_line2″}} |
Store Contact Address | {{config path=”general/store_information/address”}} |
Customer Account URL | {{var this.getUrl($store, ‘customer/account/’)}} |
Customer Email | {{var customer.email}} |
Customer Name | {{var customer.name}} |
Billing Address | {{var formattedBillingAddress|raw}} |
Email Order Note | {{var order.getEmailCustomerNote()}} |
Order ID | {{var order.increment_id}} |
Order Items Grid | {{layout handle=”sales_email_order_items” order=$order area=”frontend”}} |
Payment Details | {{var payment_html|raw}} |
Shipping Address | {{var formattedShippingAddress|raw}} |
Shipping Description | {{var order.getShippingDescription()}} |
Also Read, How to Get Store Name in Magento 2 Email Template
Hopefully, the post is useful for Magento 2 developers 😃
If that’s the case, please rate the post with 5 stars!
Thanks!
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
2 Comments
Is it possible to display country from shipping address in the email templates
Hello Yukti,
No, it’s not possible directly.
But you can try like this:
You’ll get the whole address in the formattedShippingAddress variable that’s being used in the mail.
Add custom variable programmatically.
Thank You.