I have a data ware house running in PostgreSQL server ,i'm loading data using PYTHON to the DWH from Magento, I want to consolidate all the mailing process from my DWH , for which i have devised a mailing mechanism using python.

Now my issue is how to get the order confirmation details from Magento to my DWH as I need to send an order confirmation email to users as soon as they places an order(Time period is not an issue).

So i need to understand how the mail sending mechanism in Magento is working in case of Order confirmation? Is there a trigger for that or an event? Does anyone have the SQL code for checking this?

Any ideas/suggestions will be heartily welcomed.

Using Version Magento 1.9

Thanks in advance

  • Which version of Magento are you using?
    – mtr.web
    Commented May 17, 2019 at 14:20
  • i'm using Magento version 1.9
    – Sandeep
    Commented May 17, 2019 at 14:25

1 Answer 1


I may need some (or a lot) of clarification to give a proper answer, but the event that triggers an order confirmation email is in [magento-root]/app/code/core/Mage/Sales/Model/Order.php the function named sendNewOrderEmail(), which then calls queueNewOrderEmail in the same class to do the heavy lifting.

Depending on the information that you are trying to capture, you'll probably want to look at $paymentBlock = Mage::helper('payment')->getInfoBlock($this->getPayment())

..or you could do Mage::log(array_keys($this->getData())); which would give you the data assigned to the order that you are working with. Then, you'd use $this->getData('the-key-you-found') to pull the specific information.

If you are trying to do something in sql, the data from this message and information is store in the core_email_queue and core_email_queue_recipients tables. It is not there long in most cases, and when the email cron is run, sending the email, the entry is removed. More information on that can be found here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.