Is it possible I add my email as Bcc to get email any time someone successfully subscribe for newsletter in Magento?

This is really important for us to be notified any time someone subscribe for newsletter.



class Mydons_Newsletteralert_Model_Observer 
    const XML_PATH_EMAIL_TEMPLATE = 'newsletter_alert_template';

    public function newsletteralert($observer)
        $eventname = $observer->getEvent()->getName();
        $subscriber = $observer->getEvent()->getSubscriber();
        $email = $subscriber->getEmail();
        $id = $subscriber->getId();

        $emailtemplate = Mage::getModel('core/email_template')->loadDefault(self::XML_PATH_EMAIL_TEMPLATE);
        $sender = array();
        $sender['name'] = 'admin';
        $sender['email'] = 'ghorbanisaghi@yahoo.com';
                array('subscriber' => $subscriber)
        catch(Mage_Core_Exception $e){
            echo $e->getMessage();
            Mage::log($e->getMessage(), null, 'newsletter.log');


                <newsletter_alert_template template="label" module="mydons">
                    <label>Newsletter Alert to Admin</label>

Go through this link here

Good luck...

| improve this answer | |
  • Hi Thanks for your answer the tutorial is amazing, But I still have problem! I followed the tutorial exactly but still don't get the email after subscription! Do you want me to put my code in question maybe you can take a look at it and help me out :( Thanks – Sgh Jun 2 '15 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.