Description
Preconditions and environment
- Magento 2.4.3-p3
Steps to reproduce
- Create a customer account
- Subscribe to the newsletter
- Change customer email address
Expected result
- The email address changed email is sent to the customer
- No other email than the email address update confirmation is sent.
Actual result
- The customer recieves both email changed AND newsletter subscription confirmation email.
The bug is simply that there should not be a subscription or unsubscription confirmation email sent when changing the customer email address.
The action of changing a customer account's email address has absolutely nothing to do with the newsletter whatsoever, and it is more than confusing to recieve a subscription confirmation email when I simply change my email address...
Additional information
This bug seems to be introduced in commit 47e3ada on the class \Magento\Newsletter\Model\Plugin\CustomerPlugin
with the following line:
return $customer->getEmail() !== $subscriber->getEmail() || (int)$subscriber->getCustomerId() === 0;
This is because when changing the email, the customer gets saved, triggering this Plugin and then the method suggests that the email should be sent but this has no sense.
Also, the same bug occurs if the customer is unsubscribed from the newsletter.
In this case, the email sent when changing the customer's email is not the subscription confirmation but the unsubscribe confirmation.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.