This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
app/code/Magento/Newsletter/Model Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -393,10 +393,12 @@ public function randomSequence($length = 32)
393
393
*/
394
394
public function subscribe ($ email )
395
395
{
396
+ $ sendInformationEmail = false ;
396
397
$ this ->loadByEmail ($ email );
397
398
398
399
if (!$ this ->getId ()) {
399
400
$ this ->setSubscriberConfirmCode ($ this ->randomSequence ());
401
+ $ sendInformationEmail = true ;
400
402
}
401
403
402
404
$ isConfirmNeed = $ this ->_scopeConfig ->getValue (
@@ -444,12 +446,14 @@ public function subscribe($email)
444
446
try {
445
447
/* Save model before sending out email */
446
448
$ this ->save ();
447
- if ($ isConfirmNeed === true
448
- && $ isOwnSubscribes === false
449
- ) {
450
- $ this ->sendConfirmationRequestEmail ();
451
- } else {
452
- $ this ->sendConfirmationSuccessEmail ();
449
+ if ($ sendInformationEmail ) {
450
+ if ($ isConfirmNeed === true
451
+ && $ isOwnSubscribes === false
452
+ ) {
453
+ $ this ->sendConfirmationRequestEmail ();
454
+ } else {
455
+ $ this ->sendConfirmationSuccessEmail ();
456
+ }
453
457
}
454
458
return $ this ->getStatus ();
455
459
} catch (\Exception $ e ) {
You can’t perform that action at this time.
0 commit comments