Class: MailRoom::Delivery::Postback
- Inherits:
-
Object
- Object
- MailRoom::Delivery::Postback
- Defined in:
- lib/mail_room/delivery/postback.rb
Overview
Postback Delivery method
Defined Under Namespace
Classes: Options
Instance Method Summary collapse
-
#deliver(message) ⇒ Object
deliver the message using Faraday to the configured delivery_options url.
-
#initialize(delivery_options) ⇒ Postback
constructor
Build a new delivery, hold the delivery options.
Constructor Details
#initialize(delivery_options) ⇒ Postback
Build a new delivery, hold the delivery options
19 20 21 |
# File 'lib/mail_room/delivery/postback.rb', line 19 def initialize() @delivery_options = end |
Instance Method Details
#deliver(message) ⇒ Object
deliver the message using Faraday to the configured delivery_options url
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mail_room/delivery/postback.rb', line 25 def deliver() connection = Faraday.new connection.token_auth @delivery_options.delivery_token connection.post do |request| request.url @delivery_options.delivery_url request.body = # request.options[:timeout] = 3 # request.headers['Content-Type'] = 'text/plain' end true end |