I'm working on a customer database export, but can't find where the 'general subscription' newsletter subscription field is stored in the database. I imagine it is some EAV value, but in what table and with what attribute_id?
I figured it out. The table 'newsletter_subscriber' contains several fields, the ones most meaningful for my purpose are:
- the customer entity_id
- perhaps someone can subscribe with a different email than their customer email?
- 0 = Default ( can be seen in the table structure in database )
- 1 = Subscribed
- 2 = Not Active
- 3 = Unsubscribed
- 4 = Unconfirmed
Status 1 to 4 can be seen at /app/code/core/Mage/Newsletter/Model/Subscriber.php
Note: This is not a topical or 'typed' subscription, but a global opt-in newsletter field for a Magento customer record.
Just to clarify, there is no admin functionality that lets you add new subscription list in Magento out of the box. Thus there is no subscription type field stored anywhere.
If you check the
app/design/frontend/base/default/template/customer/form/newsletter.phtml you can see that 'General Subscription' is only a label for the
<li class="control"><input type="checkbox" name="is_subscribed" id="subscription" value="1" title="<?php echo $this->__('General Subscription') ?>"<?php if($this->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="subscription"><?php echo $this->__('General Subscription') ?></label></li>
Then the controller only checks if
is_subscribed is set to true and subscribes the customer to the newsletter if it is.