Forum: Ruby on Rails Rails 3 - Delayed_Job (collectiveidea), trying to Delay Mailers - Error: NoMethodError (undefined me

Posted by CuriousNewbie (Guest)
on 2010-12-11 20:54
(Received via mailing list)
Hello, I have the following in an observer:

    UserMailer.delay.msg_notification(record)

In user_mailer.rb
class UserMailer < ActionMailer::Base
...
def msg_notification(record)
    mail(
          :to => "#{record.user.email}",
          :subject => "Notification"
          )
  end
..
end

But this errors with:

NoMethodError (undefined method `delay' for UserMailer:Class):

Any ideas? thanks
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.