Class: ChainMail::Providers::Postmark
- Defined in:
- lib/chain_mail/providers/postmark.rb
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.deliver(mail, creds) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/chain_mail/providers/postmark.rb', line 6 def self.deliver(mail, creds) payload = { From: mail.from.first, To: mail.to.join(","), Subject: mail.subject, HtmlBody: mail.body.decoded } headers = { "X-Postmark-Server-Token" => creds[:api_key], "Content-Type" => "application/json" } post_json("https://api.postmarkapp.com/email", headers, payload) end |