Class: AuthNotifier
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- AuthNotifier
- Defined in:
- app/models/auth_notifier.rb
Instance Method Summary collapse
- #account_activation(account, address = nil) ⇒ Object
- #generated_password(account, password, address = nil) ⇒ Object
Instance Method Details
#account_activation(account, address = nil) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/models/auth_notifier.rb', line 2 def account_activation(account, address=nil) if address.nil? address = account.person.primary_email_address elsif address.kind_of? EmailAddress address = address.address end @recipients = address @from = "noreply@#{[:host]}" @subject = "Your account on #{[:host]}" @body["name"] = account.person.name || "New User" @body["account"] = account @body["server_name"] = [:host] end |
#generated_password(account, password, address = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/auth_notifier.rb', line 18 def generated_password(account, password, address=nil) if address.nil? address = account.person.primary_email_address elsif address.kind_of? EmailAddress address = address.address end @recipients = address @from = "noreply@#{[:host]}" @subject = "Your password has been reset on #{[:host]}" @body["name"] = account.person.name @body["account"] = account @body["server_name"] = [:host] @body["password"] = password end |