wj-mailgun-ruby 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rubocop.yml +8 -0
  4. data/.rubocop_todo.yml +22 -0
  5. data/.ruby-env.yml.example +12 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +24 -0
  8. data/Gemfile +6 -0
  9. data/LICENSE +191 -0
  10. data/README.md +241 -0
  11. data/Rakefile +35 -0
  12. data/docs/Domains.md +54 -0
  13. data/docs/Events.md +46 -0
  14. data/docs/MessageBuilder.md +105 -0
  15. data/docs/Messages.md +107 -0
  16. data/docs/OptInHandler.md +103 -0
  17. data/docs/Snippets.md +526 -0
  18. data/docs/Suppressions.md +82 -0
  19. data/docs/Webhooks.md +40 -0
  20. data/lib/mailgun-ruby.rb +2 -0
  21. data/lib/mailgun.rb +39 -0
  22. data/lib/mailgun/address.rb +45 -0
  23. data/lib/mailgun/chains.rb +16 -0
  24. data/lib/mailgun/client.rb +199 -0
  25. data/lib/mailgun/domains/domains.rb +84 -0
  26. data/lib/mailgun/events/events.rb +120 -0
  27. data/lib/mailgun/exceptions/exceptions.rb +65 -0
  28. data/lib/mailgun/lists/opt_in_handler.rb +58 -0
  29. data/lib/mailgun/messages/batch_message.rb +125 -0
  30. data/lib/mailgun/messages/message_builder.rb +413 -0
  31. data/lib/mailgun/response.rb +62 -0
  32. data/lib/mailgun/suppressions.rb +270 -0
  33. data/lib/mailgun/version.rb +4 -0
  34. data/lib/mailgun/webhooks/webhooks.rb +101 -0
  35. data/lib/railgun.rb +8 -0
  36. data/lib/railgun/attachment.rb +56 -0
  37. data/lib/railgun/errors.rb +27 -0
  38. data/lib/railgun/mailer.rb +161 -0
  39. data/lib/railgun/message.rb +17 -0
  40. data/lib/railgun/railtie.rb +9 -0
  41. data/mailgun.gemspec +37 -0
  42. data/spec/integration/bounces_spec.rb +44 -0
  43. data/spec/integration/campaign_spec.rb +60 -0
  44. data/spec/integration/complaints_spec.rb +38 -0
  45. data/spec/integration/domains_spec.rb +39 -0
  46. data/spec/integration/email_validation_spec.rb +57 -0
  47. data/spec/integration/events_spec.rb +28 -0
  48. data/spec/integration/list_members_spec.rb +63 -0
  49. data/spec/integration/list_spec.rb +58 -0
  50. data/spec/integration/mailgun_spec.rb +121 -0
  51. data/spec/integration/messages/sample_data/mime.txt +38 -0
  52. data/spec/integration/routes_spec.rb +74 -0
  53. data/spec/integration/stats_spec.rb +15 -0
  54. data/spec/integration/suppressions_spec.rb +126 -0
  55. data/spec/integration/unsubscribes_spec.rb +42 -0
  56. data/spec/integration/webhook_spec.rb +54 -0
  57. data/spec/spec_helper.rb +45 -0
  58. data/spec/unit/connection/test_client.rb +99 -0
  59. data/spec/unit/events/events_spec.rb +50 -0
  60. data/spec/unit/lists/opt_in_handler_spec.rb +24 -0
  61. data/spec/unit/mailgun_spec.rb +127 -0
  62. data/spec/unit/messages/batch_message_spec.rb +131 -0
  63. data/spec/unit/messages/message_builder_spec.rb +584 -0
  64. data/spec/unit/messages/sample_data/mailgun_icon.png +0 -0
  65. data/spec/unit/messages/sample_data/mime.txt +38 -0
  66. data/spec/unit/messages/sample_data/rackspace_logo.jpg +0 -0
  67. data/vcr_cassettes/bounces.yml +175 -0
  68. data/vcr_cassettes/complaints.yml +175 -0
  69. data/vcr_cassettes/domains.todo.yml +42 -0
  70. data/vcr_cassettes/domains.yml +360 -0
  71. data/vcr_cassettes/email_validation.yml +167 -0
  72. data/vcr_cassettes/events.yml +108 -0
  73. data/vcr_cassettes/exceptions.yml +45 -0
  74. data/vcr_cassettes/list_members.yml +320 -0
  75. data/vcr_cassettes/mailing_list.todo.yml +43 -0
  76. data/vcr_cassettes/mailing_list.yml +390 -0
  77. data/vcr_cassettes/routes.yml +359 -0
  78. data/vcr_cassettes/send_message.yml +107 -0
  79. data/vcr_cassettes/stats.yml +44 -0
  80. data/vcr_cassettes/suppressions.yml +676 -0
  81. data/vcr_cassettes/unsubscribes.yml +191 -0
  82. data/vcr_cassettes/webhooks.yml +276 -0
  83. metadata +263 -0
@@ -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,676 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"address":"test4@example.info","code":"500","error":"integration
9
+ testing"},{"address":"test3@example.net","code":"500","error":"integration
10
+ testing"},{"address":"test2@example.org","code":"500","error":"integration
11
+ testing"},{"address":"test1@example.com","code":"500","error":"integration
12
+ testing"}]'
13
+ headers:
14
+ Accept:
15
+ - "*/*"
16
+ Accept-Encoding:
17
+ - gzip, deflate
18
+ User-Agent:
19
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
20
+ Content-Type:
21
+ - application/json
22
+ Content-Length:
23
+ - '302'
24
+ Host:
25
+ - api.mailgun.net
26
+ response:
27
+ status:
28
+ code: 200
29
+ message: OK
30
+ headers:
31
+ Server:
32
+ - nginx
33
+ Date:
34
+ - Wed, 30 Nov 2016 20:51:44 GMT
35
+ Content-Type:
36
+ - application/json; charset=utf-8
37
+ Content-Length:
38
+ - '62'
39
+ Connection:
40
+ - keep-alive
41
+ Access-Control-Allow-Origin:
42
+ - "*"
43
+ Access-Control-Max-Age:
44
+ - '600'
45
+ Access-Control-Allow-Methods:
46
+ - GET, POST, PUT, DELETE, OPTIONS
47
+ Access-Control-Allow-Headers:
48
+ - Content-Type, x-requested-with
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"message":"4 addresses have been added to the bounces table"}'
52
+ http_version:
53
+ recorded_at: Wed, 30 Nov 2016 20:53:49 GMT
54
+ - request:
55
+ method: delete
56
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/test1@example.com
57
+ body:
58
+ encoding: US-ASCII
59
+ string: ''
60
+ headers:
61
+ Accept:
62
+ - "*/*"
63
+ Accept-Encoding:
64
+ - gzip, deflate
65
+ User-Agent:
66
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
67
+ Host:
68
+ - api.mailgun.net
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - nginx
76
+ Date:
77
+ - Wed, 30 Nov 2016 20:51:44 GMT
78
+ Content-Type:
79
+ - application/json; charset=utf-8
80
+ Content-Length:
81
+ - '76'
82
+ Connection:
83
+ - keep-alive
84
+ Access-Control-Allow-Origin:
85
+ - "*"
86
+ Access-Control-Max-Age:
87
+ - '600'
88
+ Access-Control-Allow-Methods:
89
+ - GET, POST, PUT, DELETE, OPTIONS
90
+ Access-Control-Allow-Headers:
91
+ - Content-Type, x-requested-with
92
+ body:
93
+ encoding: UTF-8
94
+ string: '{"address":"test1@example.com","message":"Bounced address has been
95
+ removed"}'
96
+ http_version:
97
+ recorded_at: Wed, 30 Nov 2016 20:53:49 GMT
98
+ - request:
99
+ method: delete
100
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/test2@example.org
101
+ body:
102
+ encoding: US-ASCII
103
+ string: ''
104
+ headers:
105
+ Accept:
106
+ - "*/*"
107
+ Accept-Encoding:
108
+ - gzip, deflate
109
+ User-Agent:
110
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
111
+ Host:
112
+ - api.mailgun.net
113
+ response:
114
+ status:
115
+ code: 200
116
+ message: OK
117
+ headers:
118
+ Server:
119
+ - nginx
120
+ Date:
121
+ - Wed, 30 Nov 2016 20:51:44 GMT
122
+ Content-Type:
123
+ - application/json; charset=utf-8
124
+ Content-Length:
125
+ - '76'
126
+ Connection:
127
+ - keep-alive
128
+ Access-Control-Allow-Origin:
129
+ - "*"
130
+ Access-Control-Max-Age:
131
+ - '600'
132
+ Access-Control-Allow-Methods:
133
+ - GET, POST, PUT, DELETE, OPTIONS
134
+ Access-Control-Allow-Headers:
135
+ - Content-Type, x-requested-with
136
+ body:
137
+ encoding: UTF-8
138
+ string: '{"address":"test2@example.org","message":"Bounced address has been
139
+ removed"}'
140
+ http_version:
141
+ recorded_at: Wed, 30 Nov 2016 20:53:50 GMT
142
+ - request:
143
+ method: delete
144
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/test3@example.net
145
+ body:
146
+ encoding: US-ASCII
147
+ string: ''
148
+ headers:
149
+ Accept:
150
+ - "*/*"
151
+ Accept-Encoding:
152
+ - gzip, deflate
153
+ User-Agent:
154
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
155
+ Host:
156
+ - api.mailgun.net
157
+ response:
158
+ status:
159
+ code: 200
160
+ message: OK
161
+ headers:
162
+ Server:
163
+ - nginx
164
+ Date:
165
+ - Wed, 30 Nov 2016 20:51:45 GMT
166
+ Content-Type:
167
+ - application/json; charset=utf-8
168
+ Content-Length:
169
+ - '76'
170
+ Connection:
171
+ - keep-alive
172
+ Access-Control-Allow-Origin:
173
+ - "*"
174
+ Access-Control-Max-Age:
175
+ - '600'
176
+ Access-Control-Allow-Methods:
177
+ - GET, POST, PUT, DELETE, OPTIONS
178
+ Access-Control-Allow-Headers:
179
+ - Content-Type, x-requested-with
180
+ body:
181
+ encoding: UTF-8
182
+ string: '{"address":"test3@example.net","message":"Bounced address has been
183
+ removed"}'
184
+ http_version:
185
+ recorded_at: Wed, 30 Nov 2016 20:53:50 GMT
186
+ - request:
187
+ method: delete
188
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/test4@example.info
189
+ body:
190
+ encoding: US-ASCII
191
+ string: ''
192
+ headers:
193
+ Accept:
194
+ - "*/*"
195
+ Accept-Encoding:
196
+ - gzip, deflate
197
+ User-Agent:
198
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
199
+ Host:
200
+ - api.mailgun.net
201
+ response:
202
+ status:
203
+ code: 200
204
+ message: OK
205
+ headers:
206
+ Server:
207
+ - nginx
208
+ Date:
209
+ - Wed, 30 Nov 2016 20:51:45 GMT
210
+ Content-Type:
211
+ - application/json; charset=utf-8
212
+ Content-Length:
213
+ - '77'
214
+ Connection:
215
+ - keep-alive
216
+ Access-Control-Allow-Origin:
217
+ - "*"
218
+ Access-Control-Max-Age:
219
+ - '600'
220
+ Access-Control-Allow-Methods:
221
+ - GET, POST, PUT, DELETE, OPTIONS
222
+ Access-Control-Allow-Headers:
223
+ - Content-Type, x-requested-with
224
+ body:
225
+ encoding: UTF-8
226
+ string: '{"address":"test4@example.info","message":"Bounced address has been
227
+ removed"}'
228
+ http_version:
229
+ recorded_at: Wed, 30 Nov 2016 20:53:50 GMT
230
+ - request:
231
+ method: post
232
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes
233
+ body:
234
+ encoding: UTF-8
235
+ string: '[{"address":"test4@example.info","tag":"Tools"},{"address":"test3@example.net","tag":"Garden
236
+ & Automotive"},{"address":"test2@example.org","tag":"Toys, Jewelry & Kids"},{"address":"test1@example.com","tag":"Outdoors,
237
+ Books & Shoes"}]'
238
+ headers:
239
+ Accept:
240
+ - "*/*"
241
+ Accept-Encoding:
242
+ - gzip, deflate
243
+ User-Agent:
244
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
245
+ Content-Type:
246
+ - application/json
247
+ Content-Length:
248
+ - '233'
249
+ Host:
250
+ - api.mailgun.net
251
+ response:
252
+ status:
253
+ code: 200
254
+ message: OK
255
+ headers:
256
+ Server:
257
+ - nginx
258
+ Date:
259
+ - Wed, 30 Nov 2016 20:51:45 GMT
260
+ Content-Type:
261
+ - application/json; charset=utf-8
262
+ Content-Length:
263
+ - '67'
264
+ Connection:
265
+ - keep-alive
266
+ Access-Control-Allow-Origin:
267
+ - "*"
268
+ Access-Control-Max-Age:
269
+ - '600'
270
+ Access-Control-Allow-Methods:
271
+ - GET, POST, PUT, DELETE, OPTIONS
272
+ Access-Control-Allow-Headers:
273
+ - Content-Type, x-requested-with
274
+ body:
275
+ encoding: UTF-8
276
+ string: '{"message":"4 addresses have been added to the unsubscribes table"}'
277
+ http_version:
278
+ recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
279
+ - request:
280
+ method: delete
281
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes/test1@example.com
282
+ body:
283
+ encoding: US-ASCII
284
+ string: ''
285
+ headers:
286
+ Accept:
287
+ - "*/*"
288
+ Accept-Encoding:
289
+ - gzip, deflate
290
+ User-Agent:
291
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
292
+ Host:
293
+ - api.mailgun.net
294
+ response:
295
+ status:
296
+ code: 200
297
+ message: OK
298
+ headers:
299
+ Server:
300
+ - nginx
301
+ Date:
302
+ - Wed, 30 Nov 2016 20:51:46 GMT
303
+ Content-Type:
304
+ - application/json; charset=utf-8
305
+ Content-Length:
306
+ - '78'
307
+ Connection:
308
+ - keep-alive
309
+ Access-Control-Allow-Origin:
310
+ - "*"
311
+ Access-Control-Max-Age:
312
+ - '600'
313
+ Access-Control-Allow-Methods:
314
+ - GET, POST, PUT, DELETE, OPTIONS
315
+ Access-Control-Allow-Headers:
316
+ - Content-Type, x-requested-with
317
+ body:
318
+ encoding: UTF-8
319
+ string: '{"address":"test1@example.com","message":"Unsubscribe event has been
320
+ removed"}'
321
+ http_version:
322
+ recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
323
+ - request:
324
+ method: delete
325
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes/test2@example.org
326
+ body:
327
+ encoding: US-ASCII
328
+ string: ''
329
+ headers:
330
+ Accept:
331
+ - "*/*"
332
+ Accept-Encoding:
333
+ - gzip, deflate
334
+ User-Agent:
335
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
336
+ Host:
337
+ - api.mailgun.net
338
+ response:
339
+ status:
340
+ code: 200
341
+ message: OK
342
+ headers:
343
+ Server:
344
+ - nginx
345
+ Date:
346
+ - Wed, 30 Nov 2016 20:51:46 GMT
347
+ Content-Type:
348
+ - application/json; charset=utf-8
349
+ Content-Length:
350
+ - '78'
351
+ Connection:
352
+ - keep-alive
353
+ Access-Control-Allow-Origin:
354
+ - "*"
355
+ Access-Control-Max-Age:
356
+ - '600'
357
+ Access-Control-Allow-Methods:
358
+ - GET, POST, PUT, DELETE, OPTIONS
359
+ Access-Control-Allow-Headers:
360
+ - Content-Type, x-requested-with
361
+ body:
362
+ encoding: UTF-8
363
+ string: '{"address":"test2@example.org","message":"Unsubscribe event has been
364
+ removed"}'
365
+ http_version:
366
+ recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
367
+ - request:
368
+ method: delete
369
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes/test3@example.net
370
+ body:
371
+ encoding: US-ASCII
372
+ string: ''
373
+ headers:
374
+ Accept:
375
+ - "*/*"
376
+ Accept-Encoding:
377
+ - gzip, deflate
378
+ User-Agent:
379
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
380
+ Host:
381
+ - api.mailgun.net
382
+ response:
383
+ status:
384
+ code: 200
385
+ message: OK
386
+ headers:
387
+ Server:
388
+ - nginx
389
+ Date:
390
+ - Wed, 30 Nov 2016 20:51:46 GMT
391
+ Content-Type:
392
+ - application/json; charset=utf-8
393
+ Content-Length:
394
+ - '78'
395
+ Connection:
396
+ - keep-alive
397
+ Access-Control-Allow-Origin:
398
+ - "*"
399
+ Access-Control-Max-Age:
400
+ - '600'
401
+ Access-Control-Allow-Methods:
402
+ - GET, POST, PUT, DELETE, OPTIONS
403
+ Access-Control-Allow-Headers:
404
+ - Content-Type, x-requested-with
405
+ body:
406
+ encoding: UTF-8
407
+ string: '{"address":"test3@example.net","message":"Unsubscribe event has been
408
+ removed"}'
409
+ http_version:
410
+ recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
411
+ - request:
412
+ method: delete
413
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes/test4@example.info
414
+ body:
415
+ encoding: US-ASCII
416
+ string: ''
417
+ headers:
418
+ Accept:
419
+ - "*/*"
420
+ Accept-Encoding:
421
+ - gzip, deflate
422
+ User-Agent:
423
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
424
+ Host:
425
+ - api.mailgun.net
426
+ response:
427
+ status:
428
+ code: 200
429
+ message: OK
430
+ headers:
431
+ Server:
432
+ - nginx
433
+ Date:
434
+ - Wed, 30 Nov 2016 20:51:46 GMT
435
+ Content-Type:
436
+ - application/json; charset=utf-8
437
+ Content-Length:
438
+ - '79'
439
+ Connection:
440
+ - keep-alive
441
+ Access-Control-Allow-Origin:
442
+ - "*"
443
+ Access-Control-Max-Age:
444
+ - '600'
445
+ Access-Control-Allow-Methods:
446
+ - GET, POST, PUT, DELETE, OPTIONS
447
+ Access-Control-Allow-Headers:
448
+ - Content-Type, x-requested-with
449
+ body:
450
+ encoding: UTF-8
451
+ string: '{"address":"test4@example.info","message":"Unsubscribe event has been
452
+ removed"}'
453
+ http_version:
454
+ recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
455
+ - request:
456
+ method: post
457
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/complaints
458
+ body:
459
+ encoding: UTF-8
460
+ string: '[{"address":"test4@example.info"},{"address":"test3@example.net"},{"address":"test2@example.org"},{"address":"test1@example.com"}]'
461
+ headers:
462
+ Accept:
463
+ - "*/*"
464
+ Accept-Encoding:
465
+ - gzip, deflate
466
+ User-Agent:
467
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
468
+ Content-Type:
469
+ - application/json
470
+ Content-Length:
471
+ - '130'
472
+ Host:
473
+ - api.mailgun.net
474
+ response:
475
+ status:
476
+ code: 200
477
+ message: OK
478
+ headers:
479
+ Server:
480
+ - nginx
481
+ Date:
482
+ - Wed, 30 Nov 2016 20:51:47 GMT
483
+ Content-Type:
484
+ - application/json; charset=utf-8
485
+ Content-Length:
486
+ - '75'
487
+ Connection:
488
+ - keep-alive
489
+ Access-Control-Allow-Origin:
490
+ - "*"
491
+ Access-Control-Max-Age:
492
+ - '600'
493
+ Access-Control-Allow-Methods:
494
+ - GET, POST, PUT, DELETE, OPTIONS
495
+ Access-Control-Allow-Headers:
496
+ - Content-Type, x-requested-with
497
+ body:
498
+ encoding: UTF-8
499
+ string: '{"message":"4 complaint addresses have been added to the complaints
500
+ table"}'
501
+ http_version:
502
+ recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
503
+ - request:
504
+ method: delete
505
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/complaints/test1@example.com
506
+ body:
507
+ encoding: US-ASCII
508
+ string: ''
509
+ headers:
510
+ Accept:
511
+ - "*/*"
512
+ Accept-Encoding:
513
+ - gzip, deflate
514
+ User-Agent:
515
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
516
+ Host:
517
+ - api.mailgun.net
518
+ response:
519
+ status:
520
+ code: 200
521
+ message: OK
522
+ headers:
523
+ Server:
524
+ - nginx
525
+ Date:
526
+ - Wed, 30 Nov 2016 20:51:47 GMT
527
+ Content-Type:
528
+ - application/json; charset=utf-8
529
+ Content-Length:
530
+ - '75'
531
+ Connection:
532
+ - keep-alive
533
+ Access-Control-Allow-Origin:
534
+ - "*"
535
+ Access-Control-Max-Age:
536
+ - '600'
537
+ Access-Control-Allow-Methods:
538
+ - GET, POST, PUT, DELETE, OPTIONS
539
+ Access-Control-Allow-Headers:
540
+ - Content-Type, x-requested-with
541
+ body:
542
+ encoding: UTF-8
543
+ string: '{"address":"test1@example.com","message":"Spam complaint has been removed"}'
544
+ http_version:
545
+ recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
546
+ - request:
547
+ method: delete
548
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/complaints/test2@example.org
549
+ body:
550
+ encoding: US-ASCII
551
+ string: ''
552
+ headers:
553
+ Accept:
554
+ - "*/*"
555
+ Accept-Encoding:
556
+ - gzip, deflate
557
+ User-Agent:
558
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
559
+ Host:
560
+ - api.mailgun.net
561
+ response:
562
+ status:
563
+ code: 200
564
+ message: OK
565
+ headers:
566
+ Server:
567
+ - nginx
568
+ Date:
569
+ - Wed, 30 Nov 2016 20:51:47 GMT
570
+ Content-Type:
571
+ - application/json; charset=utf-8
572
+ Content-Length:
573
+ - '75'
574
+ Connection:
575
+ - keep-alive
576
+ Access-Control-Allow-Origin:
577
+ - "*"
578
+ Access-Control-Max-Age:
579
+ - '600'
580
+ Access-Control-Allow-Methods:
581
+ - GET, POST, PUT, DELETE, OPTIONS
582
+ Access-Control-Allow-Headers:
583
+ - Content-Type, x-requested-with
584
+ body:
585
+ encoding: UTF-8
586
+ string: '{"address":"test2@example.org","message":"Spam complaint has been removed"}'
587
+ http_version:
588
+ recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
589
+ - request:
590
+ method: delete
591
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/complaints/test3@example.net
592
+ body:
593
+ encoding: US-ASCII
594
+ string: ''
595
+ headers:
596
+ Accept:
597
+ - "*/*"
598
+ Accept-Encoding:
599
+ - gzip, deflate
600
+ User-Agent:
601
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
602
+ Host:
603
+ - api.mailgun.net
604
+ response:
605
+ status:
606
+ code: 200
607
+ message: OK
608
+ headers:
609
+ Server:
610
+ - nginx
611
+ Date:
612
+ - Wed, 30 Nov 2016 20:51:47 GMT
613
+ Content-Type:
614
+ - application/json; charset=utf-8
615
+ Content-Length:
616
+ - '75'
617
+ Connection:
618
+ - keep-alive
619
+ Access-Control-Allow-Origin:
620
+ - "*"
621
+ Access-Control-Max-Age:
622
+ - '600'
623
+ Access-Control-Allow-Methods:
624
+ - GET, POST, PUT, DELETE, OPTIONS
625
+ Access-Control-Allow-Headers:
626
+ - Content-Type, x-requested-with
627
+ body:
628
+ encoding: UTF-8
629
+ string: '{"address":"test3@example.net","message":"Spam complaint has been removed"}'
630
+ http_version:
631
+ recorded_at: Wed, 30 Nov 2016 20:53:53 GMT
632
+ - request:
633
+ method: delete
634
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/complaints/test4@example.info
635
+ body:
636
+ encoding: US-ASCII
637
+ string: ''
638
+ headers:
639
+ Accept:
640
+ - "*/*"
641
+ Accept-Encoding:
642
+ - gzip, deflate
643
+ User-Agent:
644
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
645
+ Host:
646
+ - api.mailgun.net
647
+ response:
648
+ status:
649
+ code: 200
650
+ message: OK
651
+ headers:
652
+ Server:
653
+ - nginx
654
+ Date:
655
+ - Wed, 30 Nov 2016 20:51:47 GMT
656
+ Content-Type:
657
+ - application/json; charset=utf-8
658
+ Content-Length:
659
+ - '76'
660
+ Connection:
661
+ - keep-alive
662
+ Access-Control-Allow-Origin:
663
+ - "*"
664
+ Access-Control-Max-Age:
665
+ - '600'
666
+ Access-Control-Allow-Methods:
667
+ - GET, POST, PUT, DELETE, OPTIONS
668
+ Access-Control-Allow-Headers:
669
+ - Content-Type, x-requested-with
670
+ body:
671
+ encoding: UTF-8
672
+ string: '{"address":"test4@example.info","message":"Spam complaint has been
673
+ removed"}'
674
+ http_version:
675
+ recorded_at: Wed, 30 Nov 2016 20:53:53 GMT
676
+ recorded_with: VCR 3.0.3