Class: AccountMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- AccountMailer
- Defined in:
- app/mailers/account_mailer.rb
Instance Method Summary collapse
- #created_account(id, options = {}) ⇒ Object
- #email_changed(id, old_email, old_login, notify_email, options = {}) ⇒ Object
- #password_changed(id, options = {}) ⇒ Object
- #username_reminder(email, logins) ⇒ Object
Methods inherited from ApplicationMailer
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 created_account(id, ={}) @account = Account.find(id) @contact = @account.party if @account.party.is_contact? @customer = @account.party.customer notify_emails = [] notify_emails << @account.party.customer.account.email if (@account.party.is_contact? and @account.party.customer.present? and @account.party.customer.account.present? and @account.party.customer.account.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, old_login, notify_email, ={}) @account = Account.find(id) @old_login = old_login @old_email = old_email @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, ={}) @account = Account.find(id) @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 |