Class: AuthNotifier

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/models/auth_notifier.rb

Instance Method Summary collapse

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 (, address=nil)
  if address.nil?
    address = .person.primary_email_address
  elsif address.kind_of? EmailAddress
    address = address.address
  end
  
  @recipients = address
  @from = "noreply@#{default_url_options[:host]}"
  @subject = "Your account on #{default_url_options[:host]}"
  
  @body["name"] = .person.name || "New User"
  @body["account"] = 
  @body["server_name"] = default_url_options[: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(, password, address=nil)
  if address.nil?
    address = .person.primary_email_address
  elsif address.kind_of? EmailAddress
    address = address.address
  end
  
  @recipients = address
  @from = "noreply@#{default_url_options[:host]}"
  @subject = "Your password has been reset on #{default_url_options[:host]}"
  
  @body["name"] = .person.name
  @body["account"] = 
  @body["server_name"] = default_url_options[:host]
  @body["password"] = password
end