Martijn van Hoof
Martijn van Hoof

Reputation: 760

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?

Upvotes: 1

Views: 4189

Answers (1)

MagePal Extensions
MagePal Extensions

Reputation: 17656

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)

Upvotes: 2

Related Questions