Class: AccountMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- AccountMailer
- Defined in:
- app/mailers/account_mailer.rb
Overview
ActionMailer: account.
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
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/mailers/account_mailer.rb', line 27 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? && @account.party.customer.present? && @account.party.customer.account.present? && @account.party.customer.account.email.present? notify_emails << @customer.primary_sales_rep.email if @customer.primary_sales_rep.present? && @customer.primary_sales_rep.email.present? notify_emails << @customer.secondary_sales_rep.email if @customer.secondary_sales_rep.present? && @customer.secondary_sales_rep.email.present? return if notify_emails.blank? 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
14 15 16 17 18 19 20 |
# File 'app/mailers/account_mailer.rb', line 14 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
8 9 10 11 12 |
# File 'app/mailers/account_mailer.rb', line 8 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
22 23 24 25 |
# File 'app/mailers/account_mailer.rb', line 22 def username_reminder(email, logins) @logins = logins mail to: email, subject: "Your WarmlyYours username(s)" end |