Skip to content

Commit 62fc9e3

Browse files
committed
Changed logic to get customer subscriber status
1 parent 53a789e commit 62fc9e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,14 @@ public function randomSequence($length = 32)
393393
*/
394394
public function subscribe($email)
395395
{
396-
$sendInformationEmail = false;
397396
$this->loadByEmail($email);
398397

398+
if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) {
399+
return $this->getStatus();
400+
}
401+
399402
if (!$this->getId()) {
400403
$this->setSubscriberConfirmCode($this->randomSequence());
401-
$sendInformationEmail = true;
402404
}
403405

404406
$isConfirmNeed = $this->_scopeConfig->getValue(

0 commit comments

Comments
 (0)