make sure you''re calling it via
"UserMailer.create_application_accepted" or
"UserMailer.deliver_application_accepted", not just
"UserMailer.application_accepted"
On Nov 12, 1:21 pm, Grayson Piercee
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I''m baffled but this error:
>
> NoMethodError: undefined method `application_accepted'' for
> UserMailer:Class
>         from
> c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer
> /base.rb:385:in `method_missing''
>         from D:/rails/app/models/applicant_observer.rb:11:in `after_
> save''
>         from
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record
> /observer.rb:171:in `send''
>         from
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record
> /observer.rb:171:in `update''
>         from c:/ruby/lib/ruby/1.8/observer.rb:185:in
`notify_observers''
>         from c:/ruby/lib/ruby/1.8/observer.rb:184:in `each''
>         from c:/ruby/lib/ruby/1.8/observer.rb:184:in
`notify_observers''
>
> here is the class in question
>
> require ''action_mailer/ar_mailer''
> class UserMailer < ActionMailer::ARMailer
>
>   def signup_notification(user)
>     setup_email(user)
>     @subject    += ''Welcome to''
>   end
>
>   def application_accepted(application)
>     setup_email(application.position.account)
>     @subject += "#{application.name} accepted."
>     @body[:application] = application
>   end
>
>   protected
>   def setup_email(user)
>     recipients "#{user.email}"
>     from       FROM_MAILER_STRING # Sets the User FROM Name and Email
>     subject     ""
>     body       :user => user
>     sent_on    Time.now
>   end
> end
>
> end
>
> signup_notification works fine why would this other method?
>
> Thanks,
>
> GP
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---