Magento – Magento 2 Get Order Data In Order Email Confirmation Template

emailemail-templatesmagento2order-gridsales-order

I have made a custom template to use in my order confirmation email template.

I want to get the order data in this template so I can create a custom order grid layout.

I'm not sure on how to do this? Can anyone point me in the right direction?

Best Answer

Did you check how Magento default templates works?

e.g. Magento_Sales/view/frontend/email

This is an example how to get customer name in email template:

<h1 class="greeting">{{trans "Hello %name," name=$order.getBillingAddress().getName()}}</h1>
Related Topic