-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Multiple newsletter confirmation emails sent #12876
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
Comments
@nfourteen, thank you for your report. |
Hello, |
Hi @matthiashama |
Hi @serhii-balko |
Yes, it will be merged after a while |
@serhii-balko You created a pull request to a private repository. You should create your pull request for this public repository and inside of your PR you should mention this issue. So it'll be linked automatically. |
Hi @nfourteen. Thank you for your report. The fix will be available with the upcoming patch release. |
Hi @nfourteen. Thank you for your report.
The fix will be available with the upcoming 2.3.0 release. |
Preconditions
Steps to reproduce
Stores > Configuration > Customers > Newsletter > Subscription Options > Need to Confirm
to YesExpected result
There are a couple different results that I'll leave to the Magento core team:
STATUS_UNCONFIRMED
, update the guest email with the customer data, and send the Need to Confirm email for the new account.Actual result
Reason
The first two emails are received because of the
\Magento\Newsletter\Model\Plugin\CustomerPlugin::afterSave()
method. When\Magento\Customer\Controller\Account\CreatePost::execute()
is called a new customer account is created online 313
with\Magento\Customer\Model\AccountManagement::createAccount()
. ThecreateAccount()
method callscreateAccountWithPasswordHash()
whereby the customer is saved online 748
and then that same method calls$this->changeResetPasswordLinkToken()
online 775
, which again saves the customer online 1242
. Thus these two customer saves trigger theafterSave()
method calls on theCustomerPlugin
, which updates the subscription and sends the two emails.The third and final email is received within the
Magento\Customer\Controller\Account\CreatePost::execute()
method online 317
when theis_subscribed
param is retrieved from the form data within the request and theif
conditional equalstrue
because of Step 4 above.The text was updated successfully, but these errors were encountered: