I've a custom module which sends an Pre-order confirmation email to customer before order confirmation email sent to customer.

Once admin reviewed order then only order confirmation triggered.

I would like to include Increment ID in Pre-order confirmation email's subject.

I've tried something like,

{{trans "SiteName Order #%order_id" order_id=$order.increment_id |raw}}

But doesn't seems to work with custom module's email, Whereas it worked with order confirmation email.

Any idea how can I achieve this ?? Help would be appreciated.

  • Are you able to get order id when sent pre order email..? I think you can write code for "Pre-order confirmation email" after order create and before admin review code, i think you are sending pre order email before create a order, so it's not generate your incremented id . – Sangeeta Chandaliya Nov 7 '19 at 12:49
  • Which observer do you use? – Dhaduk Mitesh Nov 7 '19 at 13:08
  • I've used checkout_onepage_controller_success_action – anonymous Nov 7 '19 at 13:16
  • @SangeetaChandaliya, No I'm not sending pre-order email before placing an order, I'm sending after order placed successfully – anonymous Nov 7 '19 at 13:16
  • Try using sales_order_save_after observer. – Dhaduk Mitesh Nov 8 '19 at 5:14

Your Answer

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

Browse other questions tagged or ask your own question.