Class: Billingly::BaseMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/billingly/base_mailer.rb

Direct Known Subclasses

Mailer

Instance Method Summary collapse

Instance Method Details

#overdue_notification(invoice) ⇒ Object



13
14
15
16
17
# File 'app/mailers/billingly/base_mailer.rb', line 13

def overdue_notification(invoice)
  @invoice = invoice
  @cash = invoice.customer.ledger[:cash]
  mail(to: invoice.customer.email, subject: I18n.t('billingly.your_account_was_suspended'))
end


19
20
21
22
# File 'app/mailers/billingly/base_mailer.rb', line 19

def paid_notification(invoice)
  @invoice = invoice
  mail(to: invoice.customer.email, subject: I18n.t('billingly.payment_receipt'))
end

#pending_notification(invoice) ⇒ Object



7
8
9
10
11
# File 'app/mailers/billingly/base_mailer.rb', line 7

def pending_notification(invoice)
  @invoice = invoice
  @cash = invoice.customer.ledger[:cash]
  mail(to: invoice.customer.email, subject: I18n.t('billingly.your_invoice_is_available'))
end

#task_results(runner) ⇒ Object



24
25
26
27
# File 'app/mailers/billingly/base_mailer.rb', line 24

def task_results(runner)
  @runner = runner
  mail to: self.class.admin_emails, subject: "Your Billingly Status Report"
end

#trial_expired_notification(subscription) ⇒ Object

Sends the email about an expired trial. param trial [Subscription] a trial which should be expired.



31
32
33
34
# File 'app/mailers/billingly/base_mailer.rb', line 31

def trial_expired_notification(subscription)
  @subscription = subscription
  mail to: subscription.customer.email, subject: I18n.t('billingly.your_trial_has_expired')
end