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)
    @message=message
    mail(to: user.email, subject: subject)
  end

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 https://groups.google.com/d/msgid/rubyonrails-talk/e57de7cd-3343-4ec1-acd1-c5c2016494c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.