Sha256: da733e61e96f09d92dcdf01ffa399f198117d27c343048f377285a1e831a184e

Contents?: true

Size: 471 Bytes

Versions: 14

Compression:

Stored size: 471 Bytes

Contents

module Mail
  class Postmark

    attr_accessor :settings

    def initialize(values)
      self.settings = { :api_key => nil }.merge(values)
    end

    def deliver!(mail)
      settings = self.settings.dup
      api_key = settings.delete(:api_key)
      api_client = ::Postmark::ApiClient.new(api_key, settings)
      response = api_client.deliver_message(mail)

      if settings[:return_response]
        response
      else
        self
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
postmark-1.4.3 lib/postmark/handlers/mail.rb
postmark-1.4.2 lib/postmark/handlers/mail.rb
postmark-1.4.1 lib/postmark/handlers/mail.rb
postmark-1.4.0 lib/postmark/handlers/mail.rb
postmark-1.3.1 lib/postmark/handlers/mail.rb
postmark-1.3.0 lib/postmark/handlers/mail.rb
postmark-1.2.1 lib/postmark/handlers/mail.rb
postmark-1.2.0 lib/postmark/handlers/mail.rb
postmark-1.1.2 lib/postmark/handlers/mail.rb
postmark-1.1.1 lib/postmark/handlers/mail.rb
postmark-1.1.0 lib/postmark/handlers/mail.rb
postmark-1.0.2 lib/postmark/handlers/mail.rb
postmark-1.0.1 lib/postmark/handlers/mail.rb
postmark-1.0.0 lib/postmark/handlers/mail.rb