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
-10
lines changed
app/code/Magento/Newsletter/Model Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -393,12 +393,14 @@ public function randomSequence($length = 32)
393
393
*/
394
394
public function subscribe ($ email )
395
395
{
396
- $ sendInformationEmail = false ;
397
396
$ this ->loadByEmail ($ email );
398
397
398
+ if ($ this ->getId () && $ this ->getStatus () == self ::STATUS_SUBSCRIBED ) {
399
+ return $ this ->getStatus ();
400
+ }
401
+
399
402
if (!$ this ->getId ()) {
400
403
$ this ->setSubscriberConfirmCode ($ this ->randomSequence ());
401
- $ sendInformationEmail = true ;
402
404
}
403
405
404
406
$ isConfirmNeed = $ this ->_scopeConfig ->getValue (
@@ -446,14 +448,12 @@ public function subscribe($email)
446
448
try {
447
449
/* Save model before sending out email */
448
450
$ this ->save ();
449
- if ($ sendInformationEmail ) {
450
- if ($ isConfirmNeed === true
451
- && $ isOwnSubscribes === false
452
- ) {
453
- $ this ->sendConfirmationRequestEmail ();
454
- } else {
455
- $ this ->sendConfirmationSuccessEmail ();
456
- }
451
+ if ($ isConfirmNeed === true
452
+ && $ isOwnSubscribes === false
453
+ ) {
454
+ $ this ->sendConfirmationRequestEmail ();
455
+ } else {
456
+ $ this ->sendConfirmationSuccessEmail ();
457
457
}
458
458
return $ this ->getStatus ();
459
459
} catch (\Exception $ e ) {
You can’t perform that action at this time.
0 commit comments