mailgun-ruby 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +22 -0
- data/.ruby-env.yml.example +12 -0
- data/.travis.yml +6 -12
- data/Domains.md +36 -0
- data/MessageBuilder.md +14 -14
- data/Messages.md +44 -30
- data/OptInHandler.md +34 -34
- data/README.md +74 -24
- data/Rakefile +22 -20
- data/Snippets.md +26 -26
- data/Webhooks.md +40 -0
- data/lib/mailgun.rb +26 -228
- data/lib/mailgun/chains.rb +16 -0
- data/lib/mailgun/client.rb +143 -0
- data/lib/mailgun/domains/domains.rb +84 -0
- data/lib/mailgun/events/events.rb +53 -35
- data/lib/mailgun/exceptions/exceptions.rb +43 -10
- data/lib/mailgun/lists/opt_in_handler.rb +18 -19
- data/lib/mailgun/messages/batch_message.rb +31 -48
- data/lib/mailgun/messages/message_builder.rb +160 -144
- data/lib/mailgun/response.rb +55 -0
- data/lib/mailgun/version.rb +2 -3
- data/lib/mailgun/webhooks/webhooks.rb +101 -0
- data/mailgun.gemspec +16 -10
- data/spec/integration/bounces_spec.rb +44 -0
- data/spec/integration/campaign_spec.rb +60 -0
- data/spec/integration/complaints_spec.rb +38 -0
- data/spec/integration/domains_spec.rb +39 -0
- data/spec/integration/email_validation_spec.rb +29 -0
- data/spec/integration/events_spec.rb +20 -0
- data/spec/integration/list_members_spec.rb +63 -0
- data/spec/integration/list_spec.rb +58 -0
- data/spec/integration/mailgun_spec.rb +26 -550
- data/spec/integration/routes_spec.rb +74 -0
- data/spec/integration/stats_spec.rb +15 -0
- data/spec/integration/unsubscribes_spec.rb +42 -0
- data/spec/integration/webhook_spec.rb +54 -0
- data/spec/spec_helper.rb +37 -7
- data/spec/unit/connection/test_client.rb +15 -95
- data/spec/unit/events/events_spec.rb +9 -6
- data/spec/unit/lists/opt_in_handler_spec.rb +6 -4
- data/spec/unit/mailgun_spec.rb +25 -19
- data/spec/unit/messages/batch_message_spec.rb +47 -38
- data/spec/unit/messages/message_builder_spec.rb +282 -111
- data/vcr_cassettes/bounces.yml +175 -0
- data/vcr_cassettes/complaints.yml +175 -0
- data/vcr_cassettes/domains.todo.yml +42 -0
- data/vcr_cassettes/domains.yml +360 -0
- data/vcr_cassettes/email_validation.yml +104 -0
- data/vcr_cassettes/events.yml +61 -0
- data/vcr_cassettes/list_members.yml +320 -0
- data/vcr_cassettes/mailing_list.todo.yml +43 -0
- data/vcr_cassettes/mailing_list.yml +390 -0
- data/vcr_cassettes/routes.yml +359 -0
- data/vcr_cassettes/send_message.yml +107 -0
- data/vcr_cassettes/stats.yml +44 -0
- data/vcr_cassettes/unsubscribes.yml +191 -0
- data/vcr_cassettes/webhooks.yml +276 -0
- metadata +114 -10
@@ -0,0 +1,107 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/messages
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: from=bob%40DOMAIN.TEST&to=sally%40DOMAIN.TEST&subject=Hash%20Integration%20Test&text=INTEGRATION%20TESTING&o%3Atestmode=true
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Length:
|
15
|
+
- '194'
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Thu, 07 Jan 2016 22:08:03 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Content-Length:
|
32
|
+
- '124'
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Content-Disposition:
|
36
|
+
- inline
|
37
|
+
Access-Control-Allow-Origin:
|
38
|
+
- "*"
|
39
|
+
Access-Control-Max-Age:
|
40
|
+
- '600'
|
41
|
+
Access-Control-Allow-Methods:
|
42
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
43
|
+
Access-Control-Allow-Headers:
|
44
|
+
- Content-Type, x-requested-with
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: |-
|
48
|
+
{
|
49
|
+
"id": "<20160107220803.53710.46802@DOMAIN.TEST>",
|
50
|
+
"message": "Queued. Thank you."
|
51
|
+
}
|
52
|
+
http_version:
|
53
|
+
recorded_at: Thu, 07 Jan 2016 22:08:03 GMT
|
54
|
+
- request:
|
55
|
+
method: post
|
56
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/messages.mime
|
57
|
+
body:
|
58
|
+
encoding: ASCII-8BIT
|
59
|
+
string: "--896727\r\nContent-Disposition: form-data; name=\"to\"\r\n\r\nsally@DOMAIN.TEST\r\n--896727\r\nContent-Disposition:
|
60
|
+
form-data; name=\"message\"; filename=\"MG_TMP_MIME20160107-14880-12qjotm\"\r\nContent-Type:
|
61
|
+
text/plain\r\n\r\n\r\n--896727--\r\n"
|
62
|
+
headers:
|
63
|
+
Accept:
|
64
|
+
- "*/*; q=0.5, application/xml"
|
65
|
+
Accept-Encoding:
|
66
|
+
- gzip, deflate
|
67
|
+
Content-Length:
|
68
|
+
- '255'
|
69
|
+
Content-Type:
|
70
|
+
- multipart/form-data; boundary=896727
|
71
|
+
User-Agent:
|
72
|
+
- Ruby
|
73
|
+
response:
|
74
|
+
status:
|
75
|
+
code: 200
|
76
|
+
message: OK
|
77
|
+
headers:
|
78
|
+
Server:
|
79
|
+
- nginx
|
80
|
+
Date:
|
81
|
+
- Thu, 07 Jan 2016 22:08:03 GMT
|
82
|
+
Content-Type:
|
83
|
+
- application/json
|
84
|
+
Content-Length:
|
85
|
+
- '124'
|
86
|
+
Connection:
|
87
|
+
- keep-alive
|
88
|
+
Content-Disposition:
|
89
|
+
- inline
|
90
|
+
Access-Control-Allow-Origin:
|
91
|
+
- "*"
|
92
|
+
Access-Control-Max-Age:
|
93
|
+
- '600'
|
94
|
+
Access-Control-Allow-Methods:
|
95
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
96
|
+
Access-Control-Allow-Headers:
|
97
|
+
- Content-Type, x-requested-with
|
98
|
+
body:
|
99
|
+
encoding: UTF-8
|
100
|
+
string: |-
|
101
|
+
{
|
102
|
+
"id": "<20160107220803.17329.90097@DOMAIN.TEST>",
|
103
|
+
"message": "Queued. Thank you."
|
104
|
+
}
|
105
|
+
http_version:
|
106
|
+
recorded_at: Thu, 07 Jan 2016 22:08:03 GMT
|
107
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/stats?event=sent&limit=50&skip=10
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Thu, 07 Jan 2016 22:08:06 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Content-Length:
|
28
|
+
- '32'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Max-Age:
|
34
|
+
- '600'
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Content-Type, x-requested-with
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"items":[],"total_count":10000}'
|
42
|
+
http_version:
|
43
|
+
recorded_at: Thu, 07 Jan 2016 22:08:06 GMT
|
44
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,191 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: address=integration-test-email%40DOMAIN.TEST&tag=*
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Length:
|
15
|
+
- '85'
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Fri, 08 Jan 2016 18:55:05 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '144'
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
- "*"
|
38
|
+
Access-Control-Max-Age:
|
39
|
+
- '600'
|
40
|
+
- '600'
|
41
|
+
Access-Control-Allow-Methods:
|
42
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
43
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
44
|
+
Access-Control-Allow-Headers:
|
45
|
+
- Content-Type, x-requested-with
|
46
|
+
- Content-Type, x-requested-with
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"address":"integration-test-email@DOMAIN.TEST","message":"Address
|
50
|
+
has been added to the unsubscribes table"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Fri, 08 Jan 2016 18:55:05 GMT
|
53
|
+
- request:
|
54
|
+
method: get
|
55
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes/integration-test-email@DOMAIN.TEST
|
56
|
+
body:
|
57
|
+
encoding: US-ASCII
|
58
|
+
string: ''
|
59
|
+
headers:
|
60
|
+
Accept:
|
61
|
+
- "*/*"
|
62
|
+
Accept-Encoding:
|
63
|
+
- gzip, deflate
|
64
|
+
User-Agent:
|
65
|
+
- Ruby
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 200
|
69
|
+
message: OK
|
70
|
+
headers:
|
71
|
+
Server:
|
72
|
+
- nginx
|
73
|
+
Date:
|
74
|
+
- Fri, 08 Jan 2016 18:55:05 GMT
|
75
|
+
Content-Type:
|
76
|
+
- application/json; charset=utf-8
|
77
|
+
Content-Length:
|
78
|
+
- '141'
|
79
|
+
Connection:
|
80
|
+
- keep-alive
|
81
|
+
Access-Control-Allow-Origin:
|
82
|
+
- "*"
|
83
|
+
- "*"
|
84
|
+
Access-Control-Max-Age:
|
85
|
+
- '600'
|
86
|
+
- '600'
|
87
|
+
Access-Control-Allow-Methods:
|
88
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
89
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
90
|
+
Access-Control-Allow-Headers:
|
91
|
+
- Content-Type, x-requested-with
|
92
|
+
- Content-Type, x-requested-with
|
93
|
+
body:
|
94
|
+
encoding: UTF-8
|
95
|
+
string: '{"address":"integration-test-email@DOMAIN.TEST","tags":["*"],"created_at":"Fri,
|
96
|
+
08 Jan 2016 18:55:04 UTC"}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Fri, 08 Jan 2016 18:55:05 GMT
|
99
|
+
- request:
|
100
|
+
method: get
|
101
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes
|
102
|
+
body:
|
103
|
+
encoding: US-ASCII
|
104
|
+
string: ''
|
105
|
+
headers:
|
106
|
+
Accept:
|
107
|
+
- "*/*"
|
108
|
+
Accept-Encoding:
|
109
|
+
- gzip, deflate
|
110
|
+
User-Agent:
|
111
|
+
- Ruby
|
112
|
+
response:
|
113
|
+
status:
|
114
|
+
code: 200
|
115
|
+
message: OK
|
116
|
+
headers:
|
117
|
+
Server:
|
118
|
+
- nginx
|
119
|
+
Date:
|
120
|
+
- Fri, 08 Jan 2016 18:55:27 GMT
|
121
|
+
Content-Type:
|
122
|
+
- application/json; charset=utf-8
|
123
|
+
Content-Length:
|
124
|
+
- '812'
|
125
|
+
Connection:
|
126
|
+
- keep-alive
|
127
|
+
Access-Control-Allow-Origin:
|
128
|
+
- "*"
|
129
|
+
- "*"
|
130
|
+
Access-Control-Max-Age:
|
131
|
+
- '600'
|
132
|
+
- '600'
|
133
|
+
Access-Control-Allow-Methods:
|
134
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
135
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
136
|
+
Access-Control-Allow-Headers:
|
137
|
+
- Content-Type, x-requested-with
|
138
|
+
- Content-Type, x-requested-with
|
139
|
+
body:
|
140
|
+
encoding: UTF-8
|
141
|
+
string: '{"items":[{"address":"integration-test-email@DOMAIN.TEST","tags":["*"],"created_at":"Fri,
|
142
|
+
08 Jan 2016 18:55:04 UTC"}],"paging":{"first":"https://api.mailgun.net/v3/DOMAIN.TEST/unsubscribes?limit=100","last":"https://api.mailgun.net/v3/DOMAIN.TEST/unsubscribes?page=last\u0026limit=100","next":"https://api.mailgun.net/v3/DOMAIN.TEST/unsubscribes?page=next\u0026address=integration-test-email%40DOMAIN.TEST\u0026limit=100","previous":"https://api.mailgun.net/v3/DOMAIN.TEST/unsubscribes?page=previous\u0026address=integration-test-email%40DOMAIN.TEST\u0026limit=100"}}'
|
143
|
+
http_version:
|
144
|
+
recorded_at: Fri, 08 Jan 2016 18:55:28 GMT
|
145
|
+
- request:
|
146
|
+
method: delete
|
147
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes/integration-test-email@DOMAIN.TEST
|
148
|
+
body:
|
149
|
+
encoding: US-ASCII
|
150
|
+
string: ''
|
151
|
+
headers:
|
152
|
+
Accept:
|
153
|
+
- "*/*; q=0.5, application/xml"
|
154
|
+
Accept-Encoding:
|
155
|
+
- gzip, deflate
|
156
|
+
User-Agent:
|
157
|
+
- Ruby
|
158
|
+
response:
|
159
|
+
status:
|
160
|
+
code: 200
|
161
|
+
message: OK
|
162
|
+
headers:
|
163
|
+
Server:
|
164
|
+
- nginx
|
165
|
+
Date:
|
166
|
+
- Fri, 08 Jan 2016 18:55:28 GMT
|
167
|
+
Content-Type:
|
168
|
+
- application/json; charset=utf-8
|
169
|
+
Content-Length:
|
170
|
+
- '130'
|
171
|
+
Connection:
|
172
|
+
- keep-alive
|
173
|
+
Access-Control-Allow-Origin:
|
174
|
+
- "*"
|
175
|
+
- "*"
|
176
|
+
Access-Control-Max-Age:
|
177
|
+
- '600'
|
178
|
+
- '600'
|
179
|
+
Access-Control-Allow-Methods:
|
180
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
181
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
182
|
+
Access-Control-Allow-Headers:
|
183
|
+
- Content-Type, x-requested-with
|
184
|
+
- Content-Type, x-requested-with
|
185
|
+
body:
|
186
|
+
encoding: UTF-8
|
187
|
+
string: '{"address":"integration-test-email@DOMAIN.TEST","message":"Unsubscribe
|
188
|
+
event has been removed"}'
|
189
|
+
http_version:
|
190
|
+
recorded_at: Fri, 08 Jan 2016 18:55:28 GMT
|
191
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,276 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/domains/DOMAIN.TEST/webhooks
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: id=bounce&url=http%3A%2F%2Fexample.com%2Fmailgun%2Fevents%2Fbounce
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Length:
|
15
|
+
- '66'
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Fri, 08 Jan 2016 19:05:55 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Content-Length:
|
32
|
+
- '117'
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Content-Disposition:
|
36
|
+
- inline
|
37
|
+
Access-Control-Allow-Origin:
|
38
|
+
- "*"
|
39
|
+
- "*"
|
40
|
+
Access-Control-Max-Age:
|
41
|
+
- '600'
|
42
|
+
- '600'
|
43
|
+
Access-Control-Allow-Methods:
|
44
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
45
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
46
|
+
Access-Control-Allow-Headers:
|
47
|
+
- Content-Type, x-requested-with
|
48
|
+
- Content-Type, x-requested-with
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: |-
|
52
|
+
{
|
53
|
+
"message": "Webhook has been created",
|
54
|
+
"webhook": {
|
55
|
+
"url": "http://example.com/mailgun/events/bounce"
|
56
|
+
}
|
57
|
+
}
|
58
|
+
http_version:
|
59
|
+
recorded_at: Fri, 08 Jan 2016 19:05:55 GMT
|
60
|
+
- request:
|
61
|
+
method: get
|
62
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/domains/DOMAIN.TEST/webhooks/bounce
|
63
|
+
body:
|
64
|
+
encoding: US-ASCII
|
65
|
+
string: ''
|
66
|
+
headers:
|
67
|
+
Accept:
|
68
|
+
- "*/*"
|
69
|
+
Accept-Encoding:
|
70
|
+
- gzip, deflate
|
71
|
+
User-Agent:
|
72
|
+
- Ruby
|
73
|
+
response:
|
74
|
+
status:
|
75
|
+
code: 200
|
76
|
+
message: OK
|
77
|
+
headers:
|
78
|
+
Server:
|
79
|
+
- nginx
|
80
|
+
Date:
|
81
|
+
- Fri, 08 Jan 2016 19:05:55 GMT
|
82
|
+
Content-Type:
|
83
|
+
- application/json
|
84
|
+
Content-Length:
|
85
|
+
- '76'
|
86
|
+
Connection:
|
87
|
+
- keep-alive
|
88
|
+
Content-Disposition:
|
89
|
+
- inline
|
90
|
+
Access-Control-Allow-Origin:
|
91
|
+
- "*"
|
92
|
+
- "*"
|
93
|
+
Access-Control-Max-Age:
|
94
|
+
- '600'
|
95
|
+
- '600'
|
96
|
+
Access-Control-Allow-Methods:
|
97
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
98
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
99
|
+
Access-Control-Allow-Headers:
|
100
|
+
- Content-Type, x-requested-with
|
101
|
+
- Content-Type, x-requested-with
|
102
|
+
body:
|
103
|
+
encoding: UTF-8
|
104
|
+
string: |-
|
105
|
+
{
|
106
|
+
"webhook": {
|
107
|
+
"url": "http://example.com/mailgun/events/bounce"
|
108
|
+
}
|
109
|
+
}
|
110
|
+
http_version:
|
111
|
+
recorded_at: Fri, 08 Jan 2016 19:05:56 GMT
|
112
|
+
- request:
|
113
|
+
method: get
|
114
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/domains/DOMAIN.TEST/webhooks
|
115
|
+
body:
|
116
|
+
encoding: US-ASCII
|
117
|
+
string: ''
|
118
|
+
headers:
|
119
|
+
Accept:
|
120
|
+
- "*/*"
|
121
|
+
Accept-Encoding:
|
122
|
+
- gzip, deflate
|
123
|
+
User-Agent:
|
124
|
+
- Ruby
|
125
|
+
response:
|
126
|
+
status:
|
127
|
+
code: 200
|
128
|
+
message: OK
|
129
|
+
headers:
|
130
|
+
Server:
|
131
|
+
- nginx
|
132
|
+
Date:
|
133
|
+
- Fri, 08 Jan 2016 19:05:56 GMT
|
134
|
+
Content-Type:
|
135
|
+
- application/json
|
136
|
+
Content-Length:
|
137
|
+
- '101'
|
138
|
+
Connection:
|
139
|
+
- keep-alive
|
140
|
+
Content-Disposition:
|
141
|
+
- inline
|
142
|
+
Access-Control-Allow-Origin:
|
143
|
+
- "*"
|
144
|
+
- "*"
|
145
|
+
Access-Control-Max-Age:
|
146
|
+
- '600'
|
147
|
+
- '600'
|
148
|
+
Access-Control-Allow-Methods:
|
149
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
150
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
151
|
+
Access-Control-Allow-Headers:
|
152
|
+
- Content-Type, x-requested-with
|
153
|
+
- Content-Type, x-requested-with
|
154
|
+
body:
|
155
|
+
encoding: UTF-8
|
156
|
+
string: |-
|
157
|
+
{
|
158
|
+
"webhooks": {
|
159
|
+
"bounce": {
|
160
|
+
"url": "http://example.com/mailgun/events/bounce"
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
164
|
+
http_version:
|
165
|
+
recorded_at: Fri, 08 Jan 2016 19:05:56 GMT
|
166
|
+
- request:
|
167
|
+
method: put
|
168
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/domains/DOMAIN.TEST/webhooks/bounce
|
169
|
+
body:
|
170
|
+
encoding: US-ASCII
|
171
|
+
string: id=bounce&url=http%3A%2F%2Fexample.com%2Fmailgun%2Fevents%2Fbounceup
|
172
|
+
headers:
|
173
|
+
Accept:
|
174
|
+
- "*/*; q=0.5, application/xml"
|
175
|
+
Accept-Encoding:
|
176
|
+
- gzip, deflate
|
177
|
+
Content-Length:
|
178
|
+
- '70'
|
179
|
+
Content-Type:
|
180
|
+
- application/x-www-form-urlencoded
|
181
|
+
User-Agent:
|
182
|
+
- Ruby
|
183
|
+
response:
|
184
|
+
status:
|
185
|
+
code: 200
|
186
|
+
message: OK
|
187
|
+
headers:
|
188
|
+
Server:
|
189
|
+
- nginx
|
190
|
+
Date:
|
191
|
+
- Fri, 08 Jan 2016 19:05:56 GMT
|
192
|
+
Content-Type:
|
193
|
+
- application/json
|
194
|
+
Content-Length:
|
195
|
+
- '121'
|
196
|
+
Connection:
|
197
|
+
- keep-alive
|
198
|
+
Content-Disposition:
|
199
|
+
- inline
|
200
|
+
Access-Control-Allow-Origin:
|
201
|
+
- "*"
|
202
|
+
- "*"
|
203
|
+
Access-Control-Max-Age:
|
204
|
+
- '600'
|
205
|
+
- '600'
|
206
|
+
Access-Control-Allow-Methods:
|
207
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
208
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
209
|
+
Access-Control-Allow-Headers:
|
210
|
+
- Content-Type, x-requested-with
|
211
|
+
- Content-Type, x-requested-with
|
212
|
+
body:
|
213
|
+
encoding: UTF-8
|
214
|
+
string: |-
|
215
|
+
{
|
216
|
+
"message": "Webhook has been updated",
|
217
|
+
"webhook": {
|
218
|
+
"url": "http://example.com/mailgun/events/bounceup"
|
219
|
+
}
|
220
|
+
}
|
221
|
+
http_version:
|
222
|
+
recorded_at: Fri, 08 Jan 2016 19:05:56 GMT
|
223
|
+
- request:
|
224
|
+
method: delete
|
225
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/domains/DOMAIN.TEST/webhooks/bounce
|
226
|
+
body:
|
227
|
+
encoding: US-ASCII
|
228
|
+
string: ''
|
229
|
+
headers:
|
230
|
+
Accept:
|
231
|
+
- "*/*; q=0.5, application/xml"
|
232
|
+
Accept-Encoding:
|
233
|
+
- gzip, deflate
|
234
|
+
User-Agent:
|
235
|
+
- Ruby
|
236
|
+
response:
|
237
|
+
status:
|
238
|
+
code: 200
|
239
|
+
message: OK
|
240
|
+
headers:
|
241
|
+
Server:
|
242
|
+
- nginx
|
243
|
+
Date:
|
244
|
+
- Fri, 08 Jan 2016 19:05:56 GMT
|
245
|
+
Content-Type:
|
246
|
+
- application/json
|
247
|
+
Content-Length:
|
248
|
+
- '121'
|
249
|
+
Connection:
|
250
|
+
- keep-alive
|
251
|
+
Content-Disposition:
|
252
|
+
- inline
|
253
|
+
Access-Control-Allow-Origin:
|
254
|
+
- "*"
|
255
|
+
- "*"
|
256
|
+
Access-Control-Max-Age:
|
257
|
+
- '600'
|
258
|
+
- '600'
|
259
|
+
Access-Control-Allow-Methods:
|
260
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
261
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
262
|
+
Access-Control-Allow-Headers:
|
263
|
+
- Content-Type, x-requested-with
|
264
|
+
- Content-Type, x-requested-with
|
265
|
+
body:
|
266
|
+
encoding: UTF-8
|
267
|
+
string: |-
|
268
|
+
{
|
269
|
+
"message": "Webhook has been deleted",
|
270
|
+
"webhook": {
|
271
|
+
"url": "http://example.com/mailgun/events/bounceup"
|
272
|
+
}
|
273
|
+
}
|
274
|
+
http_version:
|
275
|
+
recorded_at: Fri, 08 Jan 2016 19:05:57 GMT
|
276
|
+
recorded_with: VCR 3.0.1
|