Skip to content

Commit 072409e

Browse files
committed
MAGETWO-96420: [2.3.x] Customer receives newsletter unsubscription email after registering for new account
- Fixed moving subscription status to 'UNCONFIRMED' if a customer was already in 'SUBSCRIBED' status
1 parent 069d5cd commit 072409e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/code/Magento/Newsletter/Model/Subscriber.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,12 @@ protected function _updateCustomerSubscription($customerId, $subscribe)
591591
if (AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED
592592
== $this->customerAccountManagement->getConfirmationStatus($customerId)
593593
) {
594-
$status = self::STATUS_UNCONFIRMED;
594+
if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) {
595+
// if a customer was already subscribed then keep the subscribed
596+
$status = self::STATUS_SUBSCRIBED;
597+
} else {
598+
$status = self::STATUS_UNCONFIRMED;
599+
}
595600
} elseif ($isConfirmNeed) {
596601
if ($this->getStatus() != self::STATUS_SUBSCRIBED) {
597602
$status = self::STATUS_NOT_ACTIVE;

0 commit comments

Comments
 (0)