Mailer Question

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs