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)
399
399
$ this ->setSubscriberConfirmCode ($ this ->randomSequence ());
400
400
}
401
401
402
+ $ sendConfirmationEmail = true ;
403
+ if ($ this ->getStatus () == self ::STATUS_SUBSCRIBED && !$ this ->getCustomerId ()) {
404
+ $ sendConfirmationEmail = false ;
405
+ }
406
+
402
407
$ isConfirmNeed = $ this ->_scopeConfig ->getValue (
403
408
self ::XML_PATH_CONFIRMATION_FLAG ,
404
409
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
@@ -442,12 +447,14 @@ public function subscribe($email)
442
447
$ this ->setStatusChanged (true );
443
448
444
449
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
+ }
451
458
}
452
459
$ this ->save ();
453
460
return $ this ->getStatus ();
You can’t perform that action at this time.
0 commit comments