Just a quick question: If I have one Action Mailer set for a contact form, but I also would like to send an email to both Admin and Customer once an order was placed, do I need to create another Action Mailer? or do I add a method in the order_controller.rb to send the appropriate email? or do I do both? Cheers, Elle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
elle wrote:> Just a quick question: > If I have one Action Mailer set for a contact form, but I also would > like to send an email to both Admin and Customer once an order was > placed, do I need to create another Action Mailer? or do I add a > method in the order_controller.rb to send the appropriate email? or do > I do both?You can add another method to your ActionMailer (model) def admin_notification(args) : : end And add a new view admin_notification.rhtml Then call YourActionMailer.deliver_admin_notification(your_args) from your controller. (Don''t know what "args" you would have) Or specify several To''s in your existing notification. Stephan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, If I already have a Mailer class with a contact_message method for an enquiry form, can I use the same Mailer, just add methods to it if I want to send a confirmation email when an order i splaced? or should I create a new mailer? Thanks, Elle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 26 Oct 2007, at 20:24, elle wrote:> > Hi, > > If I already have a Mailer class with a contact_message method for an > enquiry form, can I use the same Mailer, just add methods to it if I > want to send a confirmation email when an order i splaced? or should I > create a new mailer? >Yes you can, but that doesn''t necessarily mean you should (in the same way that you could have a single controller containing all of your app''s actions but that would also be a bad idea). Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Fredrik. That answers my question. I will create another OrderMailer. Cheers, Elle On Oct 27, 8:23 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 26 Oct 2007, at 20:24, elle wrote: > > > > > Hi, > > > If I already have a Mailer class with a contact_message method for an > > enquiry form, can I use the same Mailer, just add methods to it if I > > want to send a confirmation email when an order i splaced? or should I > > create a new mailer? > > Yes you can, but that doesn''t necessarily mean you should (in the > same way that you could have a single controller containing all of > your app''s actions but that would also be a bad idea). > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---