Sha256: ecb9c0b1f968b9fb1875e11bc73c863fc8e8806de7cadb3edcf982e8d518ddfd

Contents?: true

Size: 576 Bytes

Versions: 2

Compression:

Stored size: 576 Bytes

Contents

module Mail
  class SimplePostmark
    def initialize(values)
      self.settings = { api_key: '********-****-****-****-************' }.merge!(values)
    end
    
    attr_accessor :settings
    
    def deliver!(mail)
      headers = {
        'Accept'                  => 'application/json',
        'ContentType'             => 'application/json',
        'X-Postmark-Server-Token' => settings[:api_key].to_s
      }
      body = mail.to_postmark.to_json
    
      Typhoeus::Request.post('http://api.postmarkapp.com/email', headers: headers, body: body)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_postmark-0.2 lib/simple_postmark/delivery_method.rb
simple_postmark-0.1 lib/simple_postmark/delivery_method.rb