Ruby on Rails Wednesday, May 30, 2018

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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
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.

No comments:

Post a Comment