On 8/4/2010 10:31 AM, David Mintz wrote:


On Tue, Aug 3, 2010 at 4:43 PM, Sudheer Satyanarayana <[email protected] <mailto:[email protected]>> wrote:


        but I think there's the disadvantage that your Zend_Mail
        resource would get instantiated at bootstrap time whether you
        need it or not -- true? -- and not every controller/action in
        my app needs to send email.

    Right.

        Finally, I suppose you could set the email configuration data
        in its own separate config file.

        Any thoughts?

    I have my email settings in the database. I have extended
    Zend_Mail and added a method setup().

    Class My_Mail extends Zend_Mail
    {

      public function setup()
      {
           // get the info to setup the clss
           // set it up
      }
    }

    Client code:

    $mail = new My_Mail();
    $mail->setup();



Hmmm -- I am starting to think in this direction. Would you regard this class as a Model and stick it in your models directory?

Parenthetically, any reason you don't do the setup in your constructor? You could have your defaults and have your constructor acception options to override them.

I am also consider a controller action helper. What do you think of that idea?


--
Support real health care reform:
http://phimg.org/

--
David Mintz
http://davidmintz.org/


All my systems have an Email Service class located in application/services. The benefit here is that I can lazy load all email objects AND have preconfigured email objects like System Email, Debug Email, etc.

Reply via email to