File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
app/code/Magento/Newsletter/Model Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,11 @@ public function subscribe($email)
399399 $ this ->setSubscriberConfirmCode ($ this ->randomSequence ());
400400 }
401401
402+ $ sendConfirmationEmail = true ;
403+ if ($ this ->getStatus () == self ::STATUS_SUBSCRIBED && !$ this ->getCustomerId ()) {
404+ $ sendConfirmationEmail = false ;
405+ }
406+
402407 $ isConfirmNeed = $ this ->_scopeConfig ->getValue (
403408 self ::XML_PATH_CONFIRMATION_FLAG ,
404409 \Magento \Store \Model \ScopeInterface::SCOPE_STORE
@@ -442,12 +447,14 @@ public function subscribe($email)
442447 $ this ->setStatusChanged (true );
443448
444449 try {
445- if ($ isConfirmNeed === true
446- && $ isOwnSubscribes === false
447- ) {
448- $ this ->sendConfirmationRequestEmail ();
449- } else {
450- $ this ->sendConfirmationSuccessEmail ();
450+ if ($ sendConfirmationEmail === true ) {
451+ if ($ isConfirmNeed === true
452+ && $ isOwnSubscribes === false
453+ ) {
454+ $ this ->sendConfirmationRequestEmail ();
455+ } else {
456+ $ this ->sendConfirmationSuccessEmail ();
457+ }
451458 }
452459 $ this ->save ();
453460 return $ this ->getStatus ();
You can’t perform that action at this time.
0 commit comments