I am having problems doing pending tasks with ActionMailer: Before doing the slow-motion:
class NotificationsMailer < ActionMailer::Base default :from => " noreply@mycompany.com " default :to => " info@mycompany.com " def new_message(message) @message = message mail(:subject => "[Company Notification] #{message.subject}") end end
and called it using this line (it worked fine):
NotificationsMailer.new_message(@message).deliver
After completing the Delayed job, all I did was change the delivery line:
NotificationsMailer.delay.new_message(@message)
In addition, I started the job queue using
rake jobs:work
I can see objects in the database if the task is closed, and I see that they appear after I started the worker, but nothing happens (not an email sent).
Update - other deferred tasks (not related to mail) work fine.
Can anyone help a newbie?
Thanks in advance!
source share