Skip to content

Failure of "Send Order Email Copy" spams customers, every minute, forever. #17152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lingwooc opened this issue Jul 25, 2018 · 5 comments
Closed
Assignees
Labels
Component: Sales Event: mm18hr Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@lingwooc
Copy link

lingwooc commented Jul 25, 2018

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

  1. Set magento2 to send a separate email copy of an order
  2. Turn on "Asyncronous email sending"
  3. Make an order

Expected result

  1. Set magento2 to send a separate email copy of an order
  2. Turn on "Asyncronous email sending"
  3. Make an order
    4 Don't spam customers

Actual result

  1. Set magento2 to send a seperate email copy of an order
  2. Turn on "Asyncronous email sending"
  3. Make an order
  4. Spam your customers
@magento-engcom-team
Copy link
Contributor

Hi @lingwooc. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@lingwooc do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jul 25, 2018
@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release help wanted labels Jul 26, 2018
@engcom-backlog-nickolas engcom-backlog-nickolas removed their assignment Jul 26, 2018
@engcom-backlog-nickolas

Hello @lingwooc, thank you for your report.
We've acknowledged the issue and added to our backlog.

@sambolek
Copy link
Contributor

#mm18hr

@sambolek sambolek self-assigned this Sep 27, 2018
@slavvka slavvka added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Oct 3, 2018
@slavvka
Copy link
Member

slavvka commented Oct 3, 2018

Hi @lingwooc. Thank you for your report.
The issue has been fixed in #18288 by @sambolek in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@magento-engcom-team
Copy link
Contributor

Hi @lingwooc. Thank you for your report.
The issue has been fixed in #18376 by @sambolek in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Event: mm18hr Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants