Magento-SMTP-Pro-Email-Extension icon indicating copy to clipboard operation
Magento-SMTP-Pro-Email-Extension copied to clipboard

Duplicate email sent for order emails

Open snowleo208 opened this issue 8 years ago • 9 comments

Hello I just installed and used this extensions with SendGrid, and when customers place orders, it send 2~5 times of the same order email. How can I solve this?

My magento version is 1.9.2.2. I have set the email with BCC email to my another email address and had set whitelabel in my SendGrid account already.

snowleo208 avatar Mar 03 '16 00:03 snowleo208

I am having the same issue. Magento version is 1.9.2.4

arion-p avatar Mar 31 '16 12:03 arion-p

I had queuing enabled. I noticed that the same set of emails sent on one cron invocation was subsequently sent again on the very next invocation. I suspect that for some reason the whole batch is wrapped in a single transaction and that transaction fails and gets rolled back (but the emails have already been sent).

I will switch to non-queued mail delivery to confirm and will report back in a few days.

Edit: I just found a set of emails that was duplicated in the same cron invocation, so my assumption is probably wrong.

arion-p avatar Apr 01 '16 09:04 arion-p

I have the same issue.

Any solution to this?

Krapulat avatar Jul 07 '16 15:07 Krapulat

try to disable queue, reapply email notif settings, add a pause between emails, reduce number of emails processed at one time.

madhifallah avatar Jul 22 '16 12:07 madhifallah

Disabling the queue does resolve the issue but this is suboptimal - emails should be sent on the background.

Your suggestions would make me think that the real issue is that two instances of the dequeuing task may run at the same time (i.e. first instance does not finish before cron starts the next instance). Either the second instance should quit immediately or there should be proper locking between them to ensure each email is processed by only one instance. However my observation that one email was sent twice in the same cron invocation doesn't fit with that scenario.

arion-p avatar Jul 22 '16 12:07 arion-p

@arion-p @madhifallah If it helps, in my system the e-mail is sent twice only with 1 payment method (credit card). And the first e-mail is sent to the Magento admin. The second one is sent to the customer and to the magento admin (in the same e-mail, without cco).

Krapulat avatar Jul 22 '16 12:07 Krapulat

I have sample problem,like image what should I do??

shenmusam avatar Jun 06 '18 05:06 shenmusam

Here is a patch I have used to remove the duplicates :

@@ -76,6 +76,7 @@ class Aschroder_SMTPPro_Model_Email_Template extends Mage_Core_Model_Email_Templ

             /** @var $emailQueue Mage_Core_Model_Email_Queue */
             $emailQueue = $this->getQueue();
+            $emailQueue->clearRecipients();
             $emailQueue->setMessageBody($text);
             $emailQueue->setMessageParameters(array(
                 'subject'           => $subject,

santerref avatar Dec 07 '18 14:12 santerref

Hello, I tried to include the line $ emailQueue-> clearRecipients (); but continues to send duplicate email. Is this a Magento or plugin bug?

rabraga avatar Feb 14 '20 14:02 rabraga