Class: AccountMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/account_mailer.rb

Instance Method Summary collapse

Methods inherited from ApplicationMailer

#null_mail

Instance Method Details

#created_account(id, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'app/mailers/account_mailer.rb', line 25

def (id, options={})
  @account = Account.find(id)
  @contact = @account.party if @account.party.is_contact?
  @customer = @account.party.customer
  notify_emails = []
  notify_emails << @account.party.customer..email if (@account.party.is_contact? and @account.party.customer.present? and @account.party.customer..present? and @account.party.customer..email.present?)
  notify_emails << @customer.primary_sales_rep.email if (@customer.primary_sales_rep.present? and @customer.primary_sales_rep.email.present?)
  notify_emails << @customer.secondary_sales_rep.email if (@customer.secondary_sales_rep.present? and @customer.secondary_sales_rep.email.present?)
  return unless notify_emails.present?
  mail to: notify_emails, subject: "WarmlyYours online account/login created linked to customer #{@customer.name} (ID: CN#{@customer.id})"
end

#email_changed(id, old_email, old_login, notify_email, options = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'app/mailers/account_mailer.rb', line 12

def email_changed(id, old_email, , notify_email, options={})
  @account = Account.find(id)
  @old_login = 
  @old_email = old_email
  @options = options
  mail to: notify_email, subject: "Your WarmlyYours online account e-mail was changed"
end

#password_changed(id, options = {}) ⇒ Object



6
7
8
9
10
# File 'app/mailers/account_mailer.rb', line 6

def password_changed(id, options={})
  @account = Account.find(id)
  @options = options
  mail to: @account.email, subject: "Your WarmlyYours online account password was changed"
end

#username_reminder(email, logins) ⇒ Object



20
21
22
23
# File 'app/mailers/account_mailer.rb', line 20

def username_reminder(email, logins)
  @logins = logins
  mail to: email, subject: "Your WarmlyYours username(s)"
end