expresspigeon-ruby 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2aaf2cb7ae311969900e94bea9466d740495805e
4
- data.tar.gz: e1f4506783ec702b655f0200b0abbf2e99a6dd5e
3
+ metadata.gz: 1091b71d05e2b52d8834c3e156b4a7abb1a7d581
4
+ data.tar.gz: 0c6c20dfb96132e211cc05090d51f83170da212c
5
5
  SHA512:
6
- metadata.gz: 7a69e5d4cde9b3dab5f835eb5ff12228888aa0cf3b3837cf3f2a71360de7cc0e7e8ccbafcdb2f38dc52fe276f40d32621002ac5cd0966f585a6538c840346d69
7
- data.tar.gz: 80c4ba1ef1dd860348e5d6db29e6897d1e6accf53b6a50f7b3f962d6d6ce364ef120e24b59c608b7a0deb0adaa83304fd21b159450d43ea204ebde0daaf3b896
6
+ metadata.gz: 63fbab303fa8bed86310e7c50208090e3466546d7f4fe782ac8dd66ac9acb89fad1d4b82dbad2e42846387316b66d6a59226752ce968d09166d5bb2c9e066d9f
7
+ data.tar.gz: b3da497b86385ec668d652dc543b48ddbc7937ddf8e93866f83ec1b02ee24cd34b1cf239487ac5f170641f47597c7fd27c2a5e5b844a760cf10cb29578587855
data/README.md CHANGED
@@ -56,6 +56,7 @@ puts MESSAGES.report message_response.id
56
56
  {first_name: 'Igor', eye_color: 'blue'}, #merge_fields
57
57
  false, #view_online
58
58
  true, #click_tracking
59
+ true, #suppress_address
59
60
  attachments #file paths to upload as attachments
60
61
  )
61
62
 
@@ -115,7 +115,7 @@ module ExpressPigeon
115
115
  payload[:reply_to] = reply_to
116
116
  payload[:subject] = subject
117
117
  payload[:from] = from
118
- payload[:merge_fields] = merge_fields
118
+ payload[:merge_fields] = merge_fields.to_json
119
119
  payload[:view_online] = view_online
120
120
  payload[:click_tracking] = click_tracking
121
121
  payload[:suppress_address] = suppress_address
@@ -1,5 +1,5 @@
1
1
  module Expresspigeon
2
2
  module API
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -142,12 +142,16 @@ describe 'transactional messages integration test' do
142
142
  payload[:from].should eq 'Jane Doe'
143
143
  payload[:subject].should eq 'Hello, Dolly!'
144
144
  payload[:template_id].should eq 123
145
- payload[:merge_fields][:eye_color].should eq 'blue'
146
- payload[:merge_fields][:body_shape].should eq 'pear'
147
145
  payload[:view_online].should eq false
148
146
  payload[:click_tracking].should eq true
149
147
  payload[:suppress_address].should eq false
150
148
  payload['attachment1.txt'].class.should eq File
149
+
150
+ payload[:merge_fields].class.should eq String
151
+ merge_fields = JSON.parse payload[:merge_fields]
152
+ merge_fields['eye_color'].should eq "blue"
153
+ merge_fields['body_shape'].should eq "pear"
154
+
151
155
  File.basename(payload['attachment1.txt']).should eq 'attachment1.txt'
152
156
  File.basename(payload['attachment2.txt']).should eq 'attachment2.txt'
153
157
  end
@@ -1,5 +1,25 @@
1
+ h2. Intro
2
+
1
3
  This directory contains Ruby scripts for manual testing some features.
2
4
 
3
- In order to point to test envv, and set the auth_key, need to source the file called set_env
5
+ In order to point to test env and set the auth_key, you need need to source the file called set_env (ignored)
6
+
7
+ h2. Curl example
8
+
4
9
 
5
-
10
+ ```
11
+ curl -X POST https://api.expresspigeon.com/messages \
12
+ -H "Content-type: multipart/form-data" \
13
+ -H "X-auth-key: XXX"\
14
+ -F template_id=123\
15
+ -F reply_to='john@doe.com'\
16
+ -F from='John Doe'\
17
+ -F to='jane@doe.com'\
18
+ -F subject='Lets go out tonight?'\
19
+ -F view_online=true\
20
+ -F suppress_address=true\
21
+ -F click_tracking=true\
22
+ -F merge_fields='{"first_name": "Jane"}'\
23
+ -F attachment=@attachments/attachment1.txt\
24
+ -F attachment=@attachments/attachment2.txt
25
+ ```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expresspigeon-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ipolevoy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-18 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client