I hope this helps !!!!!!!!!
If this helps, please comment on this post and like or share this on linkedin, facebook.
Enjoy :-) !!!!!!!!
<?php /*************** This code returns all subscribers ***************/
$objCol=Mage::getResourceModel('newsletter/subscriber_collection')->load();
$collection = $objCol;
/*************** Load the newsletter template model by $templateId *******/$tmplt=Mage::getModel('newsletter/template')->load($templateId); $message=$tmplt->getTemplateText(); foreach($collection->getItems() as $item) { $email = $item->getSubscriberEmail(); $name = $item->getSubscriberFullName(); try{ $mail = new Zend_Mail(); $mail->setFrom($tmplt->getTemplateSenderEmail()); $mail->setBodyHtml($message); $mail->addTo($email, 'recipient'); $mail->setSubject($tmplt->getTemplateSubject()); $mail->send(); echo "Newsletter sent to ".$email."<br>"; } catch(Exception $e) { echo $e->getMessage(); } } ?>
If this helps, please comment on this post and like or share this on linkedin, facebook.
Enjoy :-) !!!!!!!!