2

This is an extract of Magento 2's email template order_new.html

<!--@subject {{trans "Your %store_name order confirmation" store_name=$store.getFrontendName()}} @-->
<!--@vars {
"var formattedBillingAddress|raw":"Billing Address",
"var order.getEmailCustomerNote()":"Email Order Note",
"var order.increment_id":"Order Id",
"layout handle=\"sales_email_order_items\" order=$order area=\"frontend\"":"Order Items Grid",
"var payment_html|raw":"Payment Details",
"var formattedShippingAddress|raw":"Shipping Address",
"var order.getShippingDescription()":"Shipping Description",
"var shipping_msg":"Shipping message"
} @-->

and

{{trans "Thank you for your order from %store_name." store_name=$store.getFrontendName()}}

My questions are:

  1. What scripting language is this?
  2. What do the double curly brackets stand for?
  3. How can I access arrays? For instance customerdata['name'] does not work.
3
  1. This scripting language is called Twig. As Magento 2 is based on Symfony, Twig is built-in already.

  2. According to Twig, it used to display variables.

  3. This one is already answered. Pass Variable And Output In Custom Email Template

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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