The following can be a handy snippet. Its usage and placement is totally up to your imagination and requirements.
[php]
/* To Subscribe */
Mage::getModel(‘newsletter/subscriber’)->subscribe(‘[email protected]’);
/* To Unsubscribe */
Mage::getModel(‘newsletter/subscriber’)->loadByEmail(‘[email protected]’)->unsubscribe();
[/php]
still usefull in Magento 1.9.2 :) so thanks! but where would I add it?
@magormenessy:disqus that’s highly dependent on your scenario. Are you looking to automatically subscribe people when they create an account? Do you simply have a list of emails you’d like to subscribe? Are you looking to subscribe someone after submitting a contact form? etc. etc.