我正在尝试设置异步电子邮件发送。我正在使用延迟作业。没有 delay_job 一切正常,没有任何错误。但是当我添加:
handle_asynchronously :mail_sending_method
我收到以下错误:
A sender (Return-Path, Sender or From) required to send a message
我使用 ActionMailer 发送邮件,具体如下:
mail(:to => user.email, :from => "notifications@example.com", :subject => "Blah")
这是方法:
def phrase_email(user, tweet, keyword, phrase)
@user = user
@tweet = tweet
@keyword = keyword
@phrase = phrase
mail(:to => user.email, :from => "notifications@example.com", :subject => "Weekapp Phrase Notification")
end