3

In the Magento2 newsletter, there are 4 statuses. Here's my interpretation of them:

  1. STATUS_SUBSCRIBED - User has confirmed and subscribed to newsletter
  2. STATUS_NOT_ACTIVE - ???
  3. STATUS_UNSUBSCRIBED - User may or may not have confirmed his email address but is certainly not subscribed to newsletter
  4. STATUS_UNCONFIRMED - User has subscribed to newsletter but has not confirmed his email address

Is my understanding of the statuses correct? And what does STATUS_NOT_ACTIVE mean?

0

As far as I know, STATUS_NOT_ACTIVE is used for Newsletter confirmation:
Enable Newsletter confirmation: STORE > Configuration > CUSTOMERS > Newsletter > Need to confirm > Yes. The customer subscribes a different email.

If user subscribes own login email, confirmation doesn't needed.

Take a look: vendor/magento/module-newsletter/Model/Subscriber.php::subsc‌​ribe($email) to see more details.

  • Under what condition will STATUS_NOT_ACTIVE be set to a subscriber's status? – xenon Nov 30 '16 at 3:39
  • Take a look: vendor/magento/module-newsletter/Model/Subscriber.php::subscribe($email) to see more details. – Khoa TruongDinh Nov 30 '16 at 3:41
  • The logged customer subscribes a different email. – Khoa TruongDinh Nov 30 '16 at 3:42
  • 1
    Not really, I have tried changing email address as a logged in customer and my status remains as STATUS_SUBSCRIBED. The only time I get STATUS_NOT_ACTIVE is when I subscribe as a guest user. Is this correct? – xenon Nov 30 '16 at 3:45
  • Thanks, I not check with a guest user. In case- logged, should try: Logged > Subscribe a different email. – Khoa TruongDinh Dec 8 '16 at 13:43
0

I think your interpretation is correct for STATUS_SUBSCRIBED and STATUS_UNSUBSCRIBED, but there is a subtlety you've missed for STATUS_UNCONFIRMED.

The difference between STATUS_UNCONFIRMED and STATUS_NOT_ACTIVE hinges on whether the newsletter subscription was created as part of a customer account or was created as a stand alone newsletter sign up.

  • STATUS_SUBSCRIBED - active newsletter subscriptions
  • STATUS_NOT_ACTIVE - waiting for user to click activation link in the newsletter subscription confirmation email
  • STATUS_UNSUBSCRIBED - user or admin has unsubscribed the user from the newsletter
  • STATUS_UNCONFIRMED - waiting for the user to click the activation link the customer account confirmation email

If a visitor just subscribes to the site's newsletter, without creating an customer account at the same time, then depending on the config value of newsletter/subscription/confirm (set in Stores>>Configuration>>Customers>>Newsletter>>Subscription Options>>Need to Confirm), the associated subscription will either get the status STATUS_SUBSCRIBED or STATUS_NOT_ACTIVE.

If a visitor signs up for a new account and checks the box to subscribe to the newsletter at the same time, then depending on the config value of customer/create_account/confirm (set in Stores>>Configuration>>Customers>>Customer Configuration>>Create New Account Options>>Require Emails Confirmation), the associated newsletter subscription will either get the status STATUS_SUBSCRIBED or STATUS_UNCONFIRMED.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.