Update confirmation email on the event checkout_on

2019-08-31 03:29发布

问题:

I’m facing an issue and i’m wondering if you could help me with it ..

I need to update my confirmation email on the following event: checkout_onepage_controller_success_action, and send it only after my updates are done inside it..

Problem is I don’t find where is sent the confirmation email in the code ? and it’s probably not an observer on an event no ?

Maybe you could help me with it because i need to update this email with some important Information that I only got after I have a payment confirmation ..

Anyway I wish you a nice sunday and maybe you will be able to help me,

All the best for your different projects,

Anselme

PS i'm using magento 1.4.0.2

回答1:

Inside of the class Mage_Sales_Model_Order, there is a function sendNewOrderEmail which fires the email for the order. This is called by the checkout model (Mage_Checkout_Model_Type_Onepage, line 741 on my install). Depending on what type of information you are looking for, you may not be able to guarantee that this information is available at the time that the framework wants to send the email.

If that is the case, you could override the sales_order class and change the contents of that function. Rather than sending the email immediately, you could override the function to check for the presence of the necessary data, and send it only if the data is available. If the data is not available, you would want to add it to some sort of job queue so that it could be periodically checked for the right information and sent when necessary.

The reason for overriding the sales_order class itself is that there are several other places in the framework where the sendNewOrderEmail function is called, and changing it g



标签: magento