Magento 1 Subscribe customer programatically

This can be done with one line of code:

$subscriber = Mage::getModel('newsletter/subscriber')->subscribe('');

Please note that this will send a confirmation email to the customer.

You can then find the new email in Backend > Newsletter > Newsletter Subscribers.

You can get subscribers collection with this snippet.

$collection = Mage::getModel('newsletter/subscriber')->getCollection()
                  ->setOrder('subscriber_id', 'desc');


Lukas Stranovsky
I am the guy who made this. Sorry for typos.