0

I would like to add customer email to order confirmation email, but can't figure out how to do that. Is there any predefined variable that i can use in Transactional email templates or what does it take in order get customer email in each order confirmation email?

5 Answers 5

2

You can get customer email by below line,

{{var order.getCustomerEmail()}}
2
  • 1
    This worked for me in M2.4.0.
    – Webninja
    Oct 26, 2020 at 12:58
  • @rakesh, how do i redirect the user to sales order history page by setting url in order confirmation email
    – Jaisa
    Nov 23, 2021 at 11:45
1
<p >{{trans "Customer Email," customer_email=$order.getCustomerEmail()}}</p>
0

Used in email template:

{{var customer.email}}
0

Juste use {{var}} or {{trans}} :

<h2>{{trans "Dear, %name" name=$customer.name}}</h2>

or

<h2>{{trans "Dear,"}} {{var $customer.name}}</h2>
0

Both {{var order.customer_email}} and {{var order.getCustomerEmail()}} working in 2.3.4.

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.