Commit 05290c7b76ce28db362554a44d40f6c1f1bd0a67
1 parent
d482170f
Exists in
master
add api response
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
lib/sendcloud/deliverer.rb
@@ -22,11 +22,13 @@ module Sendcloud | @@ -22,11 +22,13 @@ module Sendcloud | ||
22 | def deliver!(rails_message) | 22 | def deliver!(rails_message) |
23 | options = build_sendcloud_message_for(rails_message) | 23 | options = build_sendcloud_message_for(rails_message) |
24 | response = sendcloud_client.send_message options | 24 | response = sendcloud_client.send_message options |
25 | - Rails.logger.info("from:#{options[:from]} to:#{options[:to]} res:#{response}") | 25 | + # Rails.logger.info("from:#{options[:from]} to:#{options[:to]} res:#{response}") |
26 | + rails_message.api_response = response | ||
26 | if response.code == 200 | 27 | if response.code == 200 |
27 | sendcloud_message_id = JSON.parse(response.to_str)["id"] | 28 | sendcloud_message_id = JSON.parse(response.to_str)["id"] |
28 | rails_message.message_id = sendcloud_message_id | 29 | rails_message.message_id = sendcloud_message_id |
29 | end | 30 | end |
31 | + | ||
30 | response | 32 | response |
31 | end | 33 | end |
32 | 34 |