0


使用delayed_job的delay方法异步执行邮件相关代码时,执行正常但收不到邮件。我们在工作中得到以下 o/p:work rake 任务控制台

[Worker(host:ip-0AASDF pid:3512)] Starting job worker
[Worker(host:ip-0AASDF pid:3512)] UserMailer.deliver_author_notification completed after 0.4850
[Worker(host:ip-0AASDF pid:3512)] 1 jobs processed at 1.3072 j/s, 0 failed ...

我有以下代码

UserMailer.delay.deliver_author_notification(self,nfication)

我正在使用rails 2.3.5 和delayed_job 2.0.8 版本。

请帮助我。先谢谢了....

4

1 回答 1

0

user_mailer.rb 包含以下代码:

class UserMailer < ActionMailer::Base
   def author_notification(user,nfication)
     @recipients = user.creator.email
     @site_url = get_site_url(user.creator.organization)
     @from = "admin@#{@site_url}"
     @body[:body_template] = eval('"'+nfication.body+'"')
     @subject = eval('"'+nfication.subject+'"')
     content_type "text/html"
   end
end
于 2013-09-05T10:26:24.107 回答