Sha256: 7320a662112452b883f55f5115cf7707f985580b3104301a2297ac398ef32443

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 Bytes

Contents

module Gossiper
  class Mailer < ActionMailer::Base

    def mail_for(notification)
      @notification = NotificationDecorator.new(notification)

      config = notification

      config.attachments.each do |filename, file|
        attachments[filename] = file
      end

      config.instance_variables.each do |name, value|
        instance_variable_set("@#{name}", value)
      end

      mail(
        from:     config.from,
        reply_to: config.reply_to,
        to:       config.to,
        cc:       config.cc,
        bcc:      config.bcc,
        subject: config.subject,
        template_name: config.template_name,
        template_path: config.template_path
      )
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gossiper-0.5.2 lib/gossiper/mailer.rb
gossiper-0.5.1 lib/gossiper/mailer.rb
gossiper-0.5.0 lib/gossiper/mailer.rb