cancel
Showing results for 
Search instead for 
Did you mean: 

Add customer variable to transactional email

Add customer variable to transactional email

I'm using the customer VAT id as our internal customer id field. I'd like to output that variable on the transactional emails (i.e. New Order, Invoice, etc). I can't figure out why it's not working. I have tried 

{{var order.customer_taxvat}}

and 

 {{trans "%customer_taxvat" customer_taxvat=$order.customer_taxvat}}

Am I completely off the wall that it should output something in the email?

2 REPLIES 2

Re: Add customer variable to transactional email

I used below code to get the customer tax/vat. It is properly working for me.
  <p>Vat Number: {{var order.getCustomerTaxvat()}}</p>
in sales order email template.


If Issue Solved, Click Kudos/Accept As solutions.

 
 

Re: Add customer variable to transactional email

You can do it like below way,

{{var order.geteCustomerTaxvat()}}

another way is,

{{trans "%customer_taxvat," name=$order.getCustomerTaxvat()}}
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial