Skip to content

Instantly share code, notes, and snippets.

@neilmiddleton
Created October 1, 2012 12:24
Show Gist options
  • Select an option

  • Save neilmiddleton/3811369 to your computer and use it in GitHub Desktop.

Select an option

Save neilmiddleton/3811369 to your computer and use it in GitHub Desktop.
Report Mailer
@report = Reports::BusinessIntelligenceReport.new
@report.customer_id = customer_id.to_i
@report.start_date = Date.strptime(start_date, "%m/%d/%Y")
@report.end_date = Date.strptime(end_date, "%m/%d/%Y")
attachments['business_intelligence_report.csv'] = @report.to_csv
mail(to: email, subject: "Business Intelligence Report") do |format|
format.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment