0

I want to send a custom email for each order that is selected cash on delivery payment method. I want to send the same email just with an additional text which is static custom text. Any help for this ?

Thanks in advance

3

Use an observer to listen for the sales_order_place_after event and put your logic in the observer function:

1) Create a module or update your config.xml

Put your observer in the <events> section like this:

<?xml version="1.0"?>
<config>
    <global>
        <models>
            ...
        </models>
        <events>
            <sales_order_place_after>
                <observers>
                    <sales_order_place_after_cod_mail>
                        <class>your_module/observer</class>
                        <method>sendCodMail</method>
                    </sales_order_place_after_cod_mail>
                </observers>
            </sales_order_place_after>
        </events>
    </global>
</config>

2) Create your Observer

in app/etc/CODEPOOL/YOURNAMESPACE/YOURMODULE/Model/Observer.php

class Yournamespace_Yourmodule {
    public function sendCodMail(Varien_Event_Observer $observer) {
        //check if order has cash on delivery payment method
        //send e-mail
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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