passing arguments to mailer

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

passing arguments to mailer

fugee ohu
I'm trying to pass the user (recipient), message (body of message) and subject to my mailer from my controller like this:
    AdminGeneralMailer.mail_to_confirmed_users(user: user, message: @message, subject: @subject).deliver_now

And then my mailer action looks like this:

  def mail_to_confirmed_users(user, message, subject)
    mail(to:, subject: subject)

And @message will be used it the template but Action Controller reports for the mailer that it expected 3 arguments and was only given 1

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit
For more options, visit