Class: IshManager::LeadsetMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- IshManager::LeadsetMailer
- Defined in:
- app/mailers/ish_manager/leadset_mailer.rb
Instance Method Summary collapse
-
#monthly_invoice(invoice_id) ⇒ Object
layout ‘mailer’.
Methods inherited from ApplicationMailer
#option_alert, #shared_galleries, #stock_alert, #test_email
Instance Method Details
#monthly_invoice(invoice_id) ⇒ Object
layout ‘mailer’
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/mailers/ish_manager/leadset_mailer.rb', line 8 def monthly_invoice invoice_id @invoice = ::Ish::Invoice.find invoice_id @leadset = @invoice.leadset path = Rails.root.join 'tmp', @invoice.filename download = open( @invoice.asset.object.url(:original) ) IO.copy_stream( download, path ) [@invoice.filename] = File.read( path ) mail( from: '[email protected]', to: @leadset.email, cc: '[email protected]', subject: "WasyaCo invoice for #{@invoice.month_on.strftime('%B')}", ) end |