Actionmailer


#1

I’m getting an error when I’m tyring to use the actionmailer.
undefined method `deliver_signup_thanks’ for Notifier:Class

This is what I have in the controller.
def emailTest
Notifier::deliver_signup_thanks()
render_text “email test”
end

This is what I have in notifier model (notifier.rb)
class Notifier < ActiveRecord::Base
def signup_thanks()
# Email header info MUST be added here
@recipients = “removed_email_address@domain.invalid”
@from = “removed_email_address@domain.invalid”
@subject = “Thank you”

# Email body substitutions go here
# @body[â??first_nameâ?] = user.first_name
# @body[â??last_nameâ?] = user.last_name

end
end

This is what I have in environment.rb
ActionMailer::Base.server_settings = {
:address => “smtp.postoffice.net”,
:port => 25,
:domain => “www.test.us”,
:user_name => ‘test’,
:password => ‘test’,
:authentication => :login
}

Can anyone see anything wrong here? Appreiciate the help. Thanks


#2

On 16 Jan '06, at 8:36 PM, ray wrote:

# @body[â??last_nameâ?] = user.last_name

end
end

That should be a subclass of ActionMailer::Base if you want to use it
to send mail…

–Jens


#3

On Tue, 2006-01-17 at 05:36 +0100, ray wrote:

This is what I have in notifier model (notifier.rb)
end
}

Can anyone see anything wrong here? Appreiciate the help. Thanks

You might try to do the following:

./script/generate mailer Notifier signup_thanks

Then look at the files it generated and compare to yours. :slight_smile:

-Robby


/**************************************************************

  • Robby R., Founder & Executive Director *
  • PLANET ARGON, LLC | www.planetargon.com *
  • Ruby on Rails Development, Consulting, and Hosting *
  • Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 *
  • blog: www.robbyonrails.com | book: www.programmingrails.com *
    ***************************************************************/