cancel
Showing results for 
Search instead for 
Did you mean: 

Add the order number to the subject in order email template

SOLVED

Add the order number to the subject in order email template

I can't figure out the syntax for this. I have made a new template which is a copy of the default one. The subject for the default is 

{{trans "Your %store_name order confirmation" store_name=$store.getFrontendName() }}

I want it to be the same but add the order id in brackets after that subject. I know the variable name, I just can't figure out the syntax. The best I have is:

{{trans "Your %store_name order confirmation (%order_id)" store_name=$store.getFrontendName() order_id=order.increment_id}} 

but it seems there is a syntax error so serious in there the whole email fails. So, what should I be putting there, and where is the ref to all the variables I can use and the syntax they follow please?

 

1 ACCEPTED SOLUTION

Accepted Solutions

[Solved] Re: Add the order number to the subject in order email template

First, sorry for posting in the wrong area, i looked for a move tool but couldn't find one.

Turns out my first attempt (not the one posted) was right, and I was using guest checkout whilst editing a non-guest template, so it's no wonder my changes weren't appearing.

 

The answer is pretty simple actually:

{{trans "Your %store_name order confirmation" store_name=$store.getFrontendName()}} #{{var order.increment_id}}

View solution in original post

4 REPLIES 4

Re: Add the order number to the subject in order email template

Have you checked devdocs? There's a lot of info on how to template email there:
http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/template-email.html

[Solved] Re: Add the order number to the subject in order email template

First, sorry for posting in the wrong area, i looked for a move tool but couldn't find one.

Turns out my first attempt (not the one posted) was right, and I was using guest checkout whilst editing a non-guest template, so it's no wonder my changes weren't appearing.

 

The answer is pretty simple actually:

{{trans "Your %store_name order confirmation" store_name=$store.getFrontendName()}} #{{var order.increment_id}}

Re: Add the order number to the subject in order email template

Of course, but thanks anyway.

Re: Add the order number to the subject in order email template

Hello,

I want Category Id of order product in order email template.

What is the short code for getting category id?