I'm upgrading an app to Rails 6 and after fixing all breaking changes I'm now facing an error when sending emails from background jobs.
I use Sidekiq through ActiveJob and I believe I've added the necessary config changes:
# config/application.rb
...
config.load_defaults 6.0
# config/initializers/new_framework_defaults_6_0.rb
...
Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
I'm sending emails using deliver_later
, like: UserMailer.notify(user).deliver_later
One important aspect is that the emails ARE being delivered even though I'm getting the error
Error message:
NameError:
uninitialized constant ActionMailer::MailDeliveryJob
Did you mean? ActionMailer::DeliveryJob
According to Rollbar the context of the error is ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper
Any help is appreciated, thanks!