1

thanks for reading, I'm trying to add new fields to newsletter in magento. Made my search and found this answer which I think it's the most right one. but when I added my observer, magento is not saving the new emails and some times the message

There was a problem with the subscription

appears. here is the code: config.xml(were my module is My_test in local):

           <newsletter_subscriber_save_before>
                <observers>
                    <class>test/newsletter_observer</class>
                    <method>add</method>
                </observers>
            </newsletter_subscriber_save_before>

and in file app/code/local/My/Test/Model/Newsletter/Observer.php :

class My_Test_Model_Newsletter_Observer{
   public function add($observer){
        // no thing here for now ..
    }
}

can any one help?? thanx in advance.

Community
  • 1
  • 1
rramiii
  • 1,156
  • 6
  • 15
  • 29

1 Answers1

1

@allGood, i see that you have missing events name

 <newsletter_subscriber_save_before>
      <observers>
      <my_newsletter>
        <class>test/newsletter_observer</class>
       <method>add</method>
     </my_newsletter>
    </observers>
  </newsletter_subscriber_save_before>

more details:http://blog.chapagain.com.np/magento-event-observer-with-save-before-and-save-after/

Amit Bera
  • 7,581
  • 7
  • 31
  • 57