3

I'm continuing my migration from rails 2.3.12 to 3.0.9 and am now working sending email notifications through Gmail.

I followed the Railscast and I can now send emails properly in my rails 3.0 app when I do:

Mailer.test_html(email).deliver

But I can't figure out how to send them as a background task. In my rails 2.3 app, I used to use the delayed_job_mailer plugin to send emails as a background task. I now deleted the plugin. I also installed a newer version of the delayed_job gem (2.1.4). But, the

Mailer.delay.test_html(email)

command doesn't send the email on my development machine. In the logs, I can see the matching task being inserted in the delayed_jobs table. But I don't know when the task is being treated and deleted from the delayed_jobs table... and I don't receive any email.

In my development.rb file, I have:

config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

but I'm not even sure if this is really useful. Any idea about what I'm missing?

1 Answer 1

4

You need to run the rake jobs:work task to have a process by Delayed Job work off jobs from that table. Without this, you will not receive any emails.

1
  • Thanks!!! Also, is it something I should include in my Capistrano recipe for my production environment?
    – alex
    Sep 1, 2011 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.