I am using Magento 1.9.1.0 .
In the backend I set up four different recipients to receive sales copy email every time a customer makes an order. The problem is that every recipient I inserted in the backend receive the same copy email multiple time.
Anyone has experienced this problem before?
Best Answer
TL;DR: use the "Bcc" option instead of the "Separate Email" option for order copy emails, because the latter is seriously broken in Magento 1.9.1. It will expose your copy email addresses to the customer.
There is something fundamentally broken with how Magento is handling this. When you have multiple (comma-separated) email addresses specified in "Send Order Email Copy To" with "Send Order Email Copy Method" set to "Separate Email", Magento creates multiple separate messages in the
core_email_queue
table - one for the customer and one for each Copy recipient.(example: set to copy to test@example.com, foobar@example.com)
That is fine - it has created separate messages for each recipient.
However the actual recipients are stored in another table -
core_email_queue_recipients
. This is where the problem is. Instead of assigning one recipient to each message, this is what happens:it assigns 1 recipient to the first message, 2 to the second, 3 to the third etc. The more recipients you have added to the Copy field, the more emails the last email on that list will receive.
What should have been added to
core_email_queue_recipients
is this:What is worse is that the emails are no longer "separate" because the email sent to the customer will have included in the "To" field a list of all the other email addresses (which should have been sent separately and without knowledge of the customer) - thus exposing to the customer your entire copy list.
Fixing this issue requires overriding and substantially rewriting the broken copy logic in
Mage/Sales/Model/Order::queueNewOrderEmail()
as well asMage/Core/Model/Email/Queue
, which isn't trivial to do.A short term fix is simply to change the copy method from "Separate Email" to "Bcc" - this option works as expected and will only generate one email.