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?

  • Please share your custom template
    – Korbin
    Commented Sep 25, 2018 at 11:50

2 Answers 2


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>
  • Yeah I have, doesn't really help as that code is generated by Magento. I need to pull the order data manually so I can create a custom layout.
    – Howliee
    Commented Sep 25, 2018 at 11:16
  • Please share more details in your answer like steps.
    – kunj
    Commented Sep 25, 2018 at 11:27

To get order details

<h1 class="greeting">{{trans "Hello %name,"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.