Magento – Magento 2 system variable for “Order Created at” for email templates

emailemail-templatesmagento2magento2.2variables

What is the email template system variable for "Order Created at" for Magento ver. 2.2.6?

Using the variable name: {{var order.getCreatedAtFormated('long')}} doesn't work for me. This is a variable applied using the Magento UI:

enter image description here

I looked into the devdocs and the is no variable for this: https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/templates/template-email.html

In addition, why are the varibale names different from when you using Magento UI and when looking at the devdocs? E.g:

Getting billing address:

  1. Using UI: {{var order.getBillingAddress().format('html')}}
  2. Devdocs: {{var formattedBillingAddress|raw}}

NOTE: I had to use the devdocs variable names for it to work properly.

Best Answer

Use :

{{var order.getCreatedAtFormatted(2)|raw}}
Related Topic