Magento – Programmatically Subscribe and Unsubscribe Newsletter Subscribers

The following can be a handy snippet. Its usage and placement is totally up to your imagination and requirements.

/* To Subscribe */
Mage::getModel('newsletter/subscriber')->subscribe('[email protected]');
/* To Unsubscribe */
Mage::getModel('newsletter/subscriber')->loadByEmail('[email protected]')->unsubscribe();