Class: Gold::BillingMailer

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

Overview

Sends billing-related emails to merchants.

Instance Method Summary collapse

Instance Method Details

#affiliate_to_paid(billing, confirmation_url) ⇒ Object



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

def affiliate_to_paid(billing, confirmation_url)
  billing.with_shopify_session do
    @shop = ShopifyAPI::Shop.current
    @confirmation_url = confirmation_url
    app_name = Gold.configuration.app_name

    mail(to: @shop.email,
         subject: "[Action Required] Charge needed for #{app_name}")
  end
end

#delinquent(billing) ⇒ Object

Inform a merchant about their non-payment.



16
17
18
19
20
21
22
23
# File 'app/mailers/gold/billing_mailer.rb', line 16

def delinquent(billing)
  billing.with_shopify_session do
    @shop = ShopifyAPI::Shop.current
    mail(to: @shop.email,
         subject: "We need you to approve a charge for " \
                  "#{Gold.configuration.app_name}")
  end
end

#suspension(billing) ⇒ Object

Inform a merchant about their account becoming suspended.



7
8
9
10
11
12
13
# File 'app/mailers/gold/billing_mailer.rb', line 7

def suspension(billing)
  billing.with_shopify_session do
    @shop = ShopifyAPI::Shop.current
    mail(to: @shop.email,
         subject: "We have suspended your access to #{Gold.configuration.app_name}")
  end
end