Magento How to send a mail to a custom person after Place order
I tried below code in observer.php
but it's not working
<?php
class Manoj_Customemail_Model_Observer{
public function customMail($event)
{
$order = $event->getOrder();
//add your mail send code here
$html="put your html content here blah blah";
$mail = Mage::getModel('core/email');
$mail->setToName('Your Name');
$mail->setToEmail('[email protected]');
$mail->setBody('Mail Text / Mail Content');
$mail->setSubject('Mail Subject');
$mail->setFromEmail('Sender Mail Id');
$mail->setFromName("Msg to Show on Subject");
$mail->setType('html');// YOu can use Html or text as Mail format
try {
$mail->send();
}
}
}
confix.xml
<?xml version="1.0"?>
<config>
<modules>
<Manoj_Customemail>
<version>0.1.0</version>
</Manoj_Customemail>
</modules>
<global>
<helpers>
<customemail>
<class>Manoj_Customemail_Helper</class>
</customemail>
</helpers>
<models>
<customemail>
<class>Manoj_Customemail_Model</class>
</customemail>
</models>
<events>
<sales_order_place_after>
<observers>
<sales_order_observer>
<type>singleton</type>
<class>Manoj_Customemail_Model_Observer</class>
<method>customMail</method>
</sales_order_observer>
</observers>
</sales_order_place_after>
</events>
</global>
</config>
After Place order it redirect to cart page
public function customMail(Varien_Event_Observer $observer)
in place ofpublic function customMail($event)