Anders Anders - 1 year ago 127
Ruby Question

Rails 4.2 - Sidekiq not sending emails in development

I have a rails app in which I have a method where I send a lot of emails. I would like to perform this action

. To do it I've tried to use
, but I can't get it to work properly - it doesn't send any emails.

Sending email worked before, so I'm certain that my email settings is set ut correctly.

In my
I have this:

gem 'sidekiq'

And I have run
bundle install
. I have also install
, followed the instructions on RailsCasts #366.

I have started
with the following command:
bundle exec sidekiq
, this resulted in what can be seen in the image below:

enter image description here

I have the following:

config.active_job.queue_adapter = :sidekiq

And I try to send the emails like this:

Mailer.deliver_new_competition_notification(member.user, @competition).deliver_later!

I don't get any errors, but the emails never gets sent.

So, have I missed something?

Answer Source

You need to bootup sidekiq with the mailer queue for it to pick up these jobs:

bundle exec sidekiq -q default -q mailers

The Sidekiq Wiki goes over the scenarios in detail here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download