Skip to content

Instantly share code, notes, and snippets.

@jessecurry
Created June 11, 2015 14:03
Show Gist options
  • Save jessecurry/5d17f241c1d2a5ce7c4b to your computer and use it in GitHub Desktop.
Save jessecurry/5d17f241c1d2a5ce7c4b to your computer and use it in GitHub Desktop.
Report Mailer
class ReportMailer < ApplicationMailer
def new_report_email recipient, report_builder
attachments['report.pdf'] = { mime_type: 'application/pdf', content: report_builder.generate_stream }
mail(to: recipient, subject: report_builder.title)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment