Search code examples
magentosendmail

Magento Send Order method


I've been looking for hours to find the right method which sends the order to the customer after payment. I found this file: /app/code/_core/Mage/Sales/Model/order.php which contains the method

/**
 * Send email with order data
 *
 * @return Mage_Sales_Model_Order
 */
public function sendNewOrderEmail()

When I completely remove this class, the order is still sent. (huh?) Yes, I cleared my cache!

What is the right sendMail method?


Solution

  • To send a order email to a customer you can do

    $_order = Mage::getModel('sales/order')->load($order_id);
    $_order->sendNewOrderEmail();
    

    sendNewOrderEmail() is define in /app/code/core/Mage/Sales/Model/Order.php (assuming that there is not custom module that modify it)