Search code examples
ruby-on-rails-5delayed-job

deliver_later with ActionMailer not sending mail in production


deliver_later with ActionMailer not sending mail in production.

I am using

rails 5.2.0 and delayed_job_active_record 4.1.3

I have tried deliver and deliver_now in production and the email is getting sent successfully. As soon as I change to deliver_later, the job gets queued but it's never executed.

if user.notify_new_event?
   EventMailer.notify_created(user.id, id).deliver_later
end

deliver_later with ActionMailer should behave like deliver_later with ActiveJob. But some how the deliver_later with ActionMailer is not working.


Solution

  • It was not the problem with ActionMailer with DelayedJob. Rather the problem was with multi-tenant application. By default delayed_job was trying to execute job from the default tenant.