Sha256: 8ce80e9c74b46a31633b2d49a4b7a3521e9c2fe89e40f1fb1ed67bf998f778a6

Contents?: true

Size: 825 Bytes

Versions: 3

Compression:

Stored size: 825 Bytes

Contents

ActionMailer::Base.view_paths = File.expand_path('../../views/', __FILE__)

class ReportMailer < ActionMailer::Base
  def daily(to)
    @title = Reparty::Email.title

    @reports = Reparty::Email.reports
    @reports.each {|r| r.attach(attachments)}
    attachments.inline['spacer.gif'] = File.read(Reparty.root + 'app/assets/images/spacer.gif')

    mail(
        from: Reparty::Email.from,
        to: to,
        subject: Reparty::Email.subject
    )
  end

  def weekly(to)
    @title = Reparty::Email.weekly_title

    @reports = Reparty::Email.weekly_reports
    @reports.each {|r| r.attach(attachments)}
    attachments.inline['spacer.gif'] = File.read(Reparty.root + 'app/assets/images/spacer.gif')

    mail(
        from: Reparty::Email.from,
        to: to,
        subject: Reparty::Email.subject
    )
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reparty-0.5.2 app/mailers/report_mailer.rb
reparty-0.5.1 app/mailers/report_mailer.rb
reparty-0.5.0 app/mailers/report_mailer.rb