0

This question already has an answer here:

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?

I looked at the IPN file at “\app\code\core\Mage\Paypal\Model\Ipn.php” and in the function _registerPaymentCapture() is generating ‘NULL’ at the line

$invoice = $payment->getCreatedInvoice()

Because of this, I cant do the regular hack recommended everywhere:

@$invoice->sendEmail();

marked as duplicate by Flyingmana, Marius, David Manners, Keyul Shah, Mufaddal Apr 2 '14 at 5:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    you never should use @ – Flyingmana Apr 1 '14 at 11:26
1

Ok this is how I have solved it myself !!

[file \app\code\core\Mage\Sales\Model\Order\Payment.php]

public function registerCaptureNotification($amount)
{
    .
    .
    .
    // at the end right before return $this;

    // Custom Code - Send email on Invoice #-
    if (!$this->getIsTransactionPending()){
    if(!$this->getIsFraudDetected()){
    if($invoice)
    {
        @$invoice->sendEmail();
        @$invoice->setEmailSent(true);
    }
    }
    }
    //#-
}

However, this will only work with Paypal IPN being called and confirmed...

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