In the Magento2 newsletter, there are 4 statuses. Here's my interpretation of them:
STATUS_SUBSCRIBED
– User has confirmed and subscribed to newsletterSTATUS_NOT_ACTIVE
– ???STATUS_UNSUBSCRIBED
– User may or may
not have confirmed his email address but is certainly not subscribed
to newsletterSTATUS_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?
Best Answer
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.
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.