Skip to content

Newsletter (un)subscription sent after changing email address #36440

Open
@Axel29

Description

@Axel29

Preconditions and environment

  • Magento 2.4.3-p3

Steps to reproduce

  1. Create a customer account
  2. Subscribe to the newsletter
  3. Change customer email address

Expected result

  1. The email address changed email is sent to the customer
  2. No other email than the email address update confirmation is sent.

Actual result

  1. 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”.

Metadata

Metadata

Assignees

Labels

Area: AccountComponent: NewsletterIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReported on 2.4.3-p3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions