Skip to content

Commit

Permalink
Integrated settings into mailers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Neath committed Aug 11, 2008
1 parent fa34dea commit 6dc70db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions app/models/password_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class PasswordMailer < ActionMailer::Base

def forgot_password(password)
setup_email(password.user)
@subject << 'You have requested to change your password'
@body[:url] = "http://YOURSITE/change_password/#{password.reset_code}"
@body[:url] = "#{APP_CONFIG['site_url']}/change_password/#{password.reset_code}"
end

def reset_password(user)
Expand All @@ -15,8 +14,8 @@ def reset_password(user)

def setup_email(user)
@recipients = "#{user.email}"
@from = "ADMINEMAIL"
@subject = "[YOURSITE] "
@from = APP_CONFIG['admin_email']
@subject = "[#{APP_CONFIG['site_name']}] "
@sent_on = Time.now
@body[:user] = user
end
Expand Down
8 changes: 4 additions & 4 deletions app/models/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ 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}"
@body[:url] = "#{APP_CONFIG['site_url']}/activate/#{user.activation_code}"
end

def activation(user)
setup_email(user)
@subject << 'Your account has been activated!'
@body[:url] = "http://YOURSITE/"
@body[:url] = APP_CONFIG['site_url']
end

protected

def setup_email(user)
@recipients = "#{user.email}"
@from = "ADMINEMAIL"
@subject = "[YOURSITE] "
@from = APP_CONFIG['admin_email']
@subject = "[#{APP_CONFIG['site_name']}] "
@sent_on = Time.now
@body[:user] = user
end
Expand Down

0 comments on commit 6dc70db

Please sign in to comment.