I am running 2.1.1, Rails 3 and have heckuva time, getting work with delayed_job puff. If I separate handle_ asynchronously from the mail program, everything works fine ... but if I return it, I will get:
undefined `name 'method for nil: NilClass (where' name 'comes from @ contact.name ... which works fine when handle_asynchronously is disabled).
If I delete all the information about the @contact template, I get:
"Sender (Return-Path, Sender or From) required to send a message?"
Am I doing something wrong or something? Relevant code below ( my@email.here replaced by legal email address)
class ContactMailer < ActionMailer::Base
default :from => "my@email.here"
def contact_mail(contact)
@contact = contact
mail(:to => ENV['MANAGER_EMAIL'], :subject => 'Delayed Job Test', :from => 'my@email.here', :content_type => 'text/plain')
end
handle_asynchronously :contact_mail, :run_at => Proc.new { 2.seconds.from_now }
end
Any suggestions are greatly appreciated.