Sha256: adeeae7b6c5439fd41c730b94ee2fa149536acc01948b66118514b67ff5a47ea

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

module Mail
  class SimplePostmark
    include HTTParty

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

    attr_accessor :settings
    base_uri 'http://api.postmarkapp.com'
    headers 'Accept' => 'application/json', 'ContentType' => 'application/json'

    def deliver!(mail)
      api_key = { 'X-Postmark-Server-Token' => settings[:api_key].to_s }
      
      self.class.post('/email', :headers => self.class.headers.merge(api_key), :body => mail.to_postmark.to_json)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_postmark18-0.4.0 lib/simple_postmark/delivery_method.rb