I've got a legacy site I'm working on that is giving me a new error. It's Rails 5.1.0.rc2.
Site uses the below similar coding in other mailer actions, which are giving this error:
Error performing ActionMailer::DeliveryJob (Job ID: 03897c07-3397-4b37-8c62-cfcf12dd1905) from Async(mailers) in 244.32ms: NoMethodError (undefined method `deliver_later' for #<Mail::Message:0x007fe7e5c9d9c8>
Did you mean? delivery_handler):
/home/dave/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:1396:in `method_missing'
controller:
UserMailer.hpe_new_vehicle_applicant(@dealer,@vehicle,@user).deliver_later
user_mailer:
def hpe_new_vehicle_applicant(dealer,vehicle,user)
@dealer = dealer
@vehicle = vehicle
@user = user
account_emails = @dealer.sales_persons.where.not(confirmed_at: nil).pluck(:email)
subject = "no reply - New Vehicle Applicant (#{@dealer.dealer_name})"
account_emails.each do |email|
send_user_mail(email, subject).deliver_later
end
end
I'm thinking the code worked previously, but I'm not sure. Also no changes have been done except to update bcrypt gem. ... I'm also not seeing why send_user_mail is being used. No real results show when googled.
Update: 'send_user_mail(email, subject)' was a call to a function within user_mailer that sent the email, which at some point acquired .deliver_later that broke it.