cancel
Showing results for 
Search instead for 
Did you mean: 

Override specific block in new order email

SOLVED

Override specific block in new order email

Hi,

 

How are we supposed to override the "Payment method" info block in a new order email?

Overriding this payment info block in the email seems to be more complicated than doing it in other places around M2.

 

Thanks a lot for your answers.

9 REPLIES

Re: Override specific block in new order email

Hi @davidfiaty,

 

I didn't tried yet but maybe this old examples can help to try to understand a little bit more: https://github.com/magento/magento2-samples/tree/master/sample-module-payment-gateway

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Override specific block in new order email

thank you for this link. I already had the sample module. I'm not sure what you are suggesting.

Are you saying that there is an example of order email block override in this sample module?

Re: Override specific block in new order email

Hi @davidfiaty,

 

Sorry, I misunderstood the question at the beginning.

I guess you want to add extra/specific content when your payment method is used, right?

 

If that is the case I don't have an example but I can recommed to follow this blog https://www.maxpronko.com/blog/tagSmiley Tongueayment to get more information about payment modules on Magento2.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Override specific block in new order email

thank you for this, very good blog. Unfortunately I haven't found anything related to my question. Have I missed something?

Re: Override specific block in new order email

Nope, you're right.

Right know I can't extra info or examples. I was looking for some modules on github of well known gateways integrations but I didn't found what (I think) you're looking for.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Override specific block in new order email

I just want to override blocks in the new order email.

Re: Override specific block in new order email

Re: Override specific block in new order email

Also, I've found this open isssue: https://github.com/magento/magento2/issues/3724

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Override specific block in new order email

Thank you @Damian Culotta for your insight. The best answer that actually works to override specific content in the order email through event observers, as described in the accepted answer here:

https://magento.stackexchange.com/questions/159142/override-model-function-magento-2