Sha256: 5df6c02ec399491cc11cac9db33973a0b20b3d560496fb9f57aac273a51c3284
Contents?: true
Size: 611 Bytes
Versions: 47
Compression:
Stored size: 611 Bytes
Contents
require 'open-uri' class IshManager::LeadsetMailer < IshManager::ApplicationMailer default from: 'WasyaCo Consulting <hello@wasya.co>' # layout 'mailer' 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 ) attachments[@invoice.filename] = File.read( path ) mail( to: @leadset.email, subject: "WasyaCo invoice for #{@invoice.month_on.strftime('%B')}", ) end end
Version data entries
47 entries across 47 versions & 1 rubygems