Created
January 17, 2010 20:12
-
-
Save elricstorm/279557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserMailer < ApplicationMailer | |
def signup_notification(user) | |
setup_email(user) | |
@subject += 'Please activate your new account.' | |
@body[:url] = "http://localhost:3000/activate/#{user.activation_code}" | |
end | |
def activation(user) | |
setup_email(user) | |
@subject += 'Your account has been activated!' | |
@body[:url] = 'http://localhost:3000/' | |
end | |
def forgot_password(user) | |
setup_email(user) | |
@subject += 'You have requested to change your password' | |
@body[:url] = "http://localhost:3000/reset_password/#{user.password_reset_code}" | |
end | |
def reset_password(user) | |
setup_email(user) | |
@subject += 'Your password has been reset.' | |
end | |
protected | |
def setup_email(user) | |
@recipients = "#{user.email}" | |
@from = "youradmin@yourdomain.com" | |
@subject = "Your Site Name: " | |
@sent_on = Time.now | |
@body[:user] = user | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment