[symfony-users] Re: Sending mail from a Form class.

2010-07-04 Thread cosmy
Thank you Bernhard, this reply is very usefull! I'll call the mailer in this way For the others: now my function works. There was a problem in exim configuration with one of the addresses (so one address not working is enough to invalid the entire email). I have to realize a newsletter now.. but i

Re: [symfony-users] Re: Sending mail from a Form class.

2010-07-04 Thread Bernhard Schussek
I disagree that this is a good use case for the event dispatcher. The event dispatcher is good for providing hooks for additional, _optional_ functionality (like logging, profiling etc.) Sending a mail upon form submission is not optional. This has to happen. You want to be able to test that it ha

[symfony-users] Re: Sending mail from a Form class.

2010-07-03 Thread cosmy
I don't embed the form.. where should i put this function if I want that an email is sent when a new article is posted (in the backend)? And why it doesn't work into the form class using sfContext::getInstance(), and it works in an action using $this ? @Richtermeister: I've never used eventdispatc

[symfony-users] Re: Sending mail from a Form class.

2010-07-02 Thread Johannes
doSave() is probably not the right place since it never gets called if you embed the PostForm somewhere. Johannes On Jul 2, 3:12 pm, cosmy wrote: > On 2 Lug, 05:58, pghoratiu wrote: > > > From the first one the actual send is missing: > > >                   // send the email > >              

[symfony-users] Re: Sending mail from a Form class.

2010-07-02 Thread cosmy
On 2 Lug, 05:58, pghoratiu wrote: > From the first one the actual send is missing: > >                   // send the email >                   $this->getMailer()->send($mail); > >     gabriel > It still doesn't work.. -- If you want to report a vulnerability issue on symfony, please send it to

[symfony-users] Re: Sending mail from a Form class.

2010-07-01 Thread Richtermeister
Hey there, overall this is a perfect case for using the eventdispatcher. That way you can keep the form focused on what it's good at (validation), and handle notifications outside. The form already has access to the eventdispatcher, so all it takes is firing an event that carries the post object t

[symfony-users] Re: Sending mail from a Form class.

2010-07-01 Thread pghoratiu
>From the first one the actual send is missing: // send the email $this->getMailer()->send($mail); gabriel On Jul 2, 5:25 am, Cosimo Zecchi wrote: > Hi all.. I think it's a strange behavior: if I send email inside an   > action it will be sent. If I try t