If you want to add some custom fields for Magento newsletter subscriber (for example subscriber_name), you should do the following:
- Add new column for
newsletter_subscriber
table
- Add text input to newsletter template
- Create observer for newsletter_subscriber_save_before event
In the observer you can get your custom field's value from request and assign it to subscriber's object:
public function newsletterSubscriberSave(Varien_Event_Observer $observer)
{
$subscriber = $observer->getEvent()->getSubscriber();
$name = Mage::app()->getRequest()->getParam('subscriber_name');
$subscriber->setSubscriberName($name);
return $this;
}
UPDATE:
Here is the detailed article explaining how to add Country field
Also, I have created a free module, it is available on the GitHub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…