1

I have Magento 1.6.0.0 and I use Paypal Express Checkout. The issue is that Invoice emails are not automatically sent. It says at the invoice details page:

the invoice email is not sent

Can someone tell me whats the issue here?

The Order confirmation emails are sent successfully and I think Paypal data is also getting captured via IPN (or by PDT) as I am getting "Payment Information" filled with data coming from paypal.

Let me know how to get this solved.

Thanks a lot.

1

1 Answer 1

4

config.xml

<global>
   <events>
        <sales_order_payment_pay>
            <observers>
                <some_module_node>
                    <class>Some_Module_Model_Observer</class>
                    <method>salesOrderPaymentPay</method>
                </some_module_node>
            </observers>
        </sales_order_payment_pay>
    </events>
</global>

Observer.php:

class Some_Module_Model_Observer
{
    public function salesOrderPaymentPay($observer)
    {
        /**
         * @var $invoice Mage_Sales_Model_Order_Invoice
         * @var $paymentMethod Mage_Payment_Model_Method_Abstract
         */
        $invoice       = $observer->getEvent()->getInvoice();
        $paymentMethod = $observer->getEvent()->getPayment()->getMethodInstance();
        if ($paymentMethod->getCode() == Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS && !$invoice->getEmailSent()) {
            $invoice->sendEmail(TRUE);
        }

    }
}
7
  • ok, i am adding it Mage_Paypal_Model_Observer Jul 23, 2013 at 6:48
  • also, which config.xml should I add it to? Jul 23, 2013 at 6:48
  • app/code/local/Some/Module/etc/config.xml
    – mageUz
    Jul 23, 2013 at 6:50
  • I have created a config.xml at \app\code\local\Mage\Paypal\Module\etc I hope this works now... Jul 23, 2013 at 7:21
  • no, didnt work... perhaps wrong directory.... can you please tell me exactly what directory to make config and observer for it to work? Jul 23, 2013 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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