I have created a custom module for sending order email to customer on order success.
my config.xml file :
...
<checkout_onepage_controller_success_action>
<observers>
<company_customizeorderemail_checkout_onepage_controller_success_action>
<class>Company_CustomizeOrderEmail_Model_Observer</class>
<method>send_order_email</method>
</company_customizeorderemail_checkout_onepage_controller_success_action>
</observers>
</checkout_onepage_controller_success_action>
...
My observer file has function as following :
public function send_order_email($observer)
{
try
{
$order_ids = $observer->getData('order_ids');
$order_id = $order_ids[0];
$order = Mage::getModel('sales/order')->load($order_id);
/* send new order email */
$order->sendNewOrderEmail();
return;
}
catch (Exception $e)
{
Mage::log($e->getMessage());
}
}
this module send email on order success but order success page
showing page content on white page, it means there is problem in loading layout.
What is the problem in my custom module?
Or Is there any another method to send order email?