Skip to content

Conversation

@iGerchak
Copy link
Contributor

Preconditions

  1. Magento 2.2.4 or 2.2.5
  2. Wyomind Cron Scheduler v1.4.0

Description

We installed Wyomind Cron Scheduler v1.4.0 and in the result, we have duplicates email (5-6 emails for 1 order).
This hotfix warns against similar situations with sending duplicate emails and adds a limit of 50 emails per cronjob.

Steps to reproduce:

  1. Disable crontab
  2. Make 2 or more orders
  3. Enable crontab

Expected result

No duplicate Emails.

Actual result

Duplicate Emails.

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Aug 10, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @iGerchak. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed - it's not good idea to clean collection every time. It's better to fix root of the issue - this object should NOT be shared. Please add shared="false" to https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Sales/etc/di.xml#L355-L395

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. AFAIK current page is set to 1 by default, no need to specify it
  2. Could you extract 50 to system configuration, near sales_email/general/async_sending and make it configurable via admin? Please make it configurable globally only (the same as sales_email/general/async_sending)

@iGerchak iGerchak force-pushed the Fix-sending-duplicate-emails branch 2 times, most recently from ce7c92b to 0b8bfaf Compare August 10, 2018 10:56
@ihor-sviziev ihor-sviziev reopened this Aug 13, 2018
@ihor-sviziev
Copy link
Contributor

Reopened this PR just to restart Travis builds

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not limiting email sending, you're limiting how many entities (orders/shipments/etc) will be processed per one cron run.
Please Update label and description

@magento-engcom-team magento-engcom-team added this to the Release: 2.2.7 milestone Aug 14, 2018
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-2787 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@iGerchak thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build on travis failed. Could you update tests?

@magento-engcom-team
Copy link
Contributor

Hi @iGerchak. Thank you for your contribution.
We will aim to release these changes as part of 2.2.7.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants