Class: Caboose::InvoicesMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/caboose/invoices_mailer.rb

Instance Method Summary collapse

Instance Method Details

#customer_new_invoice(invoice) ⇒ Object

Sends a confirmation email to the customer about a new invoice



23
24
25
26
# File 'app/mailers/caboose/invoices_mailer.rb', line 23

def customer_new_invoice(invoice)
  @invoice = invoice
  mail(:to => invoice.customer.email, :subject => 'Thank you for your order!')
end

#customer_payment_authorization(invoice) ⇒ Object

Sends an email to the customer telling them they need to authorize payment on an invoice



49
50
51
52
# File 'app/mailers/caboose/invoices_mailer.rb', line 49

def customer_payment_authorization(invoice)      
  @invoice = invoice
  mail(:to => invoice.customer.email, :subject => "Invoice #{@invoice.invoice_number} ready for payment")
end

#customer_receipt(invoice) ⇒ Object

Sends an email to the customer telling them they need to authorize payment on an invoice



55
56
57
58
# File 'app/mailers/caboose/invoices_mailer.rb', line 55

def customer_receipt(invoice)      
  @invoice = invoice
  mail(:to => invoice.customer.email, :subject => "Invoice #{@invoice.invoice_number} receipt")
end

#customer_status_updated(invoice) ⇒ Object

Sends a notification email to the customer that the status of the invoice has been changed



43
44
45
46
# File 'app/mailers/caboose/invoices_mailer.rb', line 43

def customer_status_updated(invoice)      
  @invoice = invoice
  mail(:to => invoice.customer.email, :subject => 'Order status update')
end

#fulfillment_new_invoice(invoice) ⇒ Object

Sends a notification email to the fulfillment dept about a new invoice



29
30
31
32
33
# File 'app/mailers/caboose/invoices_mailer.rb', line 29

def fulfillment_new_invoice(invoice)      
  @invoice = invoice
  sc = invoice.site.store_config
  mail(:to => sc.fulfillment_email, :subject => 'New Order')
end

#shipping_invoice_ready(invoice) ⇒ Object

Sends a notification email to the shipping dept that an invoice is ready to be shipped



36
37
38
39
40
# File 'app/mailers/caboose/invoices_mailer.rb', line 36

def shipping_invoice_ready(invoice)      
  @invoice = invoice
  sc = invoice.site.store_config
  mail(:to => sc.shipping_email, :subject => 'Order ready for shipping')
end