cours0708/P5B/ruby/3dossmanno_annuaire/app/models/user_mailer.rb

25 lines
589 B
Ruby
Raw Permalink Normal View History

2008-11-25 21:11:16 +00:00
class UserMailer < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += 'Please activate your new account'
@body[:url] = "http://YOURSITE/activate/#{user.activation_code}"
end
def activation(user)
setup_email(user)
@subject += 'Your account has been activated!'
@body[:url] = "http://YOURSITE/"
end
protected
def setup_email(user)
@recipients = "#{user.email}"
@from = "ADMINEMAIL"
@subject = "[YOURSITE] "
@sent_on = Time.now
@body[:user] = user
end
end