Files path :

./app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php
./app/design/frontend/base/default/template/newsletter/subscribe.phtml

Magento Newsletter subscriber import script

Add Subscriber

<?php
require_once("./app/Mage.php");
Mage::app();

$subscribers = array('email1@server1.com', 'email2@server2.com');

foreach ($subscribers as $email) {
# create new subscriber without send an confirmation email
Mage::getModel('newsletter/subscriber')->setImportMode(true)->subscribe($email);

# get just generated subscriber
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);

# change status to "subscribed" and save
$subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED);
$subscriber->save();
}
?>

List all subscribers

<?php
require_once("./app/Mage.php");
Mage::app();

$collection = Mage::getResourceModel('newsletter/subscriber_collection')->load();

foreach($collection->getItems() as $subscriber) {
echo $subscriber->getSubscriberEmail();
}
?>


Related Contents to follow