Skip to content
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

#28422 :- Newsletter subscription confirmation email never sent again #29510

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/code/Magento/Newsletter/Model/SubscriptionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ private function saveSubscriber(
&& (int)$subscriber->getCustomerId() === (int)$customer->getId()
&& (int)$subscriber->getStoreId() === $storeId
&& !$emailChanged
&& $status !== Subscriber::STATUS_NOT_ACTIVE
) {
return false;
}
Expand All @@ -220,10 +221,10 @@ private function saveSubscriber(

/**
* If the subscriber is waiting to confirm from the customer
* and customer changed the email
* or customer changed the email
* than need to send confirmation letter to the new email
*/
return $status === Subscriber::STATUS_NOT_ACTIVE && $emailChanged;
return $status === Subscriber::STATUS_NOT_ACTIVE || $emailChanged;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function subscribeCustomerDataProvider(): array
'subscriber_status' => Subscriber::STATUS_SUBSCRIBED,
'subscriber_confirm_code' => '',
],
'needToSendEmail' => false,
'needToSendEmail' => true,
],
'Update subscription data: subscription confirm required ' => [
'subscriber_data' => [
Expand Down Expand Up @@ -618,7 +618,7 @@ public function unsubscribeCustomerDataProvider(): array
'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE,
'subscriber_confirm_code' => '',
],
'needToSendEmail' => false,
'needToSendEmail' => true,
],
'Update subscription data' => [
'subscriber_data' => [
Expand All @@ -642,7 +642,7 @@ public function unsubscribeCustomerDataProvider(): array
'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED,
'subscriber_confirm_code' => '',
],
'needToSendEmail' => false,
'needToSendEmail' => true,
],
];
}
Expand Down