-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: SalesEvent: mm18hrFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasehelp wanted
Description
Magento 2.2.5 resends emails to customers if the "Send Order Email Copy" feature fails. This is due to a naive check in Magento\Sales\Model\Order\Email\Sender.php . It was PR #14051 to fix #13769 that did it.
It doesn't discriminate between a failure in the email copy (probably to a company address) and an email to a customer. If the copy fails repeatedly (I've literally never had this feature work) then it will spam your customers once a minute for ever. This is super dumb.
This is the code:
try {
$sender->send();
$sender->sendCopyTo();
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
return false;
}
return true;
It should probably be:
try {
$sender->send();
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
return false;
}
try {
$sender->sendCopyTo();
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
}
return true;
Although really its a great demonstration of why using a boolean to determine an error state isn't a great idea.
Preconditions
Magento 2.2.5
Broken "Send Order Email Copy"
Asyncronous email sending
Steps to reproduce
- Set magento2 to send a separate email copy of an order
- Turn on "Asyncronous email sending"
- Make an order
Expected result
- Set magento2 to send a separate email copy of an order
- Turn on "Asyncronous email sending"
- Make an order
4 Don't spam customers
Actual result
- Set magento2 to send a seperate email copy of an order
- Turn on "Asyncronous email sending"
- Make an order
- Spam your customers
Metadata
Metadata
Assignees
Labels
Component: SalesEvent: mm18hrFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasehelp wanted