Skip to content

Instantly share code, notes, and snippets.

@borisd
Created January 6, 2013 16:03
Show Gist options
  • Save borisd/4468162 to your computer and use it in GitHub Desktop.
Save borisd/4468162 to your computer and use it in GitHub Desktop.
class ReportsMailer < ActionMailer::Base
default :from => "iPawn Reports <reports@ipawn.com>"
def report(report, data)
@report = report
attachments["report.csv"] = { :data => data, :mime_type => 'text/csv' }
mail(:to => report.emails,
:subject => "iPawn report: #{@report.name}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment