Class: MailRoom::Delivery::Postback
- Inherits:
-
Object
- Object
- MailRoom::Delivery::Postback
- Defined in:
- lib/mail_room/delivery/postback.rb
Overview
Postback Delivery method
Instance Method Summary collapse
-
#deliver(message) ⇒ Object
deliver the message using Faraday to the configured mailbox url.
-
#initialize(mailbox) ⇒ Postback
constructor
Build a new delivery, hold the mailbox configuration.
Constructor Details
#initialize(mailbox) ⇒ Postback
Build a new delivery, hold the mailbox configuration
10 11 12 |
# File 'lib/mail_room/delivery/postback.rb', line 10 def initialize(mailbox) @mailbox = mailbox end |
Instance Method Details
#deliver(message) ⇒ Object
deliver the message using Faraday to the configured mailbox url
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mail_room/delivery/postback.rb', line 16 def deliver() connection = Faraday.new connection.token_auth @mailbox.delivery_token connection.post do |request| request.url @mailbox.delivery_url request.body = # request.options[:timeout] = 3 # request.headers['Content-Type'] = 'text/plain' end end |