Sha256: 33d2720c9cf8f90007348c2c41fdb539778221fdb3fd8d91ba58e3b426c2b1ae

Contents?: true

Size: 571 Bytes

Versions: 9

Compression:

Stored size: 571 Bytes

Contents

require 'cerberus/publisher/base'

class Cerberus::Publisher::Gmailer < Cerberus::Publisher::Base
  def self.publish(state, manager, options)
    require 'gmailer'

    subject, body = Cerberus::Publisher::Base.formatted_message(state, manager, options)

    gopts = options[:publisher, :gmailer]
    recipients = gopts[:recipients]
    GMailer.connect(gopts) do |g|
      success = g.send(:to => recipients, :subject => subject, :body => body, :from => gopts[:recipients])

      raise 'Unable to send mail using Gmailer' unless success
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cerberus-0.4.0 lib/cerberus/publisher/gmailer.rb
cerberus-0.4.3 lib/cerberus/publisher/gmailer.rb
cerberus-0.4.4 lib/cerberus/publisher/gmailer.rb
cerberus-0.4.2 lib/cerberus/publisher/gmailer.rb
cerberus-0.4.1 lib/cerberus/publisher/gmailer.rb
cerberus-0.4.5.1 lib/cerberus/publisher/gmailer.rb
cerberus-0.4.5 lib/cerberus/publisher/gmailer.rb
cerberus-0.5 lib/cerberus/publisher/gmailer.rb
cerberus-0.6 lib/cerberus/publisher/gmailer.rb