Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoMethodError: undefined method `deliver_now'

I have this in my controller:

  def create
    @user = User.new(user_params)
    if @user.save
      UserMailer.account_activation(@user).deliver_now
    ....
  end

And I keep getting this error:

NoMethodError: undefined method `deliver_now' for #<ActionMailer::MessageDelivery:0x007ffa6646eb60>

Any ideas why it's not finding the deliver_now method?

like image 289
Bruno Avatar asked Oct 15 '14 21:10

Bruno


2 Answers

deliver_now has been introduced in rails 4.2.beta2. You are probably using earlier version.

like image 174
katafrakt Avatar answered Sep 20 '22 08:09

katafrakt


I think it's because it's deliver (or deliver! for the bang version) and not deliver_now.

See ActionMailer::Base

like image 41
Fred Perrin Avatar answered Sep 20 '22 08:09

Fred Perrin