mailgun-ruby 1.1.9 → 1.2.12

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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -0
  3. data/.rubocop_todo.yml +0 -0
  4. data/.ruby-env.yml.example +0 -0
  5. data/.travis.yml +6 -5
  6. data/CHANGELOG.md +16 -0
  7. data/Gemfile +1 -1
  8. data/README.md +27 -3
  9. data/docs/Domains.md +3 -0
  10. data/docs/OptInHandler.md +1 -1
  11. data/docs/Snippets.md +54 -61
  12. data/docs/Webhooks.md +0 -0
  13. data/docs/railgun/Overview.md +11 -0
  14. data/docs/railgun/Parameters.md +83 -0
  15. data/docs/railgun/Templates.md +92 -0
  16. data/lib/mailgun/address.rb +3 -28
  17. data/lib/mailgun/chains.rb +0 -0
  18. data/lib/mailgun/client.rb +44 -9
  19. data/lib/mailgun/domains/domains.rb +20 -2
  20. data/lib/mailgun/events/events.rb +2 -2
  21. data/lib/mailgun/exceptions/exceptions.rb +28 -1
  22. data/lib/mailgun/messages/batch_message.rb +1 -0
  23. data/lib/mailgun/messages/message_builder.rb +56 -8
  24. data/lib/mailgun/response.rb +7 -0
  25. data/lib/mailgun/suppressions.rb +15 -8
  26. data/lib/mailgun/templates/templates.rb +187 -0
  27. data/lib/mailgun/version.rb +1 -1
  28. data/lib/mailgun/webhooks/webhooks.rb +2 -2
  29. data/lib/mailgun-ruby.rb +1 -1
  30. data/lib/mailgun.rb +4 -1
  31. data/lib/railgun/mailer.rb +83 -12
  32. data/lib/railgun/message.rb +2 -1
  33. data/lib/railgun/railtie.rb +3 -2
  34. data/mailgun.gemspec +15 -12
  35. data/spec/integration/bounces_spec.rb +3 -3
  36. data/spec/integration/campaign_spec.rb +0 -0
  37. data/spec/integration/complaints_spec.rb +0 -0
  38. data/spec/integration/domains_spec.rb +8 -0
  39. data/spec/integration/email_validation_spec.rb +10 -2
  40. data/spec/integration/events_spec.rb +1 -1
  41. data/spec/integration/list_members_spec.rb +0 -0
  42. data/spec/integration/list_spec.rb +0 -0
  43. data/spec/integration/mailer_spec.rb +67 -0
  44. data/spec/integration/mailgun_spec.rb +92 -1
  45. data/spec/integration/routes_spec.rb +0 -0
  46. data/spec/integration/stats_spec.rb +0 -0
  47. data/spec/integration/suppressions_spec.rb +18 -2
  48. data/spec/integration/templates_spec.rb +135 -0
  49. data/spec/integration/unsubscribes_spec.rb +0 -0
  50. data/spec/integration/webhook_spec.rb +0 -0
  51. data/spec/spec_helper.rb +3 -1
  52. data/spec/unit/connection/test_client.rb +18 -1
  53. data/spec/unit/events/events_spec.rb +19 -0
  54. data/spec/unit/mailgun_spec.rb +43 -2
  55. data/spec/unit/messages/batch_message_spec.rb +56 -40
  56. data/spec/unit/messages/message_builder_spec.rb +149 -16
  57. data/spec/unit/messages/sample_data/unknown.type +0 -0
  58. data/spec/unit/railgun/mailer_spec.rb +388 -0
  59. data/vcr_cassettes/bounces.yml +12 -12
  60. data/vcr_cassettes/complaints.yml +0 -0
  61. data/vcr_cassettes/domains.todo.yml +0 -0
  62. data/vcr_cassettes/domains.yml +51 -1
  63. data/vcr_cassettes/email_validation.yml +5 -5
  64. data/vcr_cassettes/events.yml +0 -0
  65. data/vcr_cassettes/exceptions-invalid-api-key.yml +52 -0
  66. data/vcr_cassettes/exceptions-invalid-data.yml +52 -0
  67. data/vcr_cassettes/exceptions-not-allowed.yml +54 -0
  68. data/vcr_cassettes/list_members.yml +0 -0
  69. data/vcr_cassettes/mailer_invalid_domain.yml +109 -0
  70. data/vcr_cassettes/mailing_list.todo.yml +0 -0
  71. data/vcr_cassettes/mailing_list.yml +0 -0
  72. data/vcr_cassettes/message_deliver.yml +149 -0
  73. data/vcr_cassettes/routes.yml +0 -0
  74. data/vcr_cassettes/send_message.yml +0 -0
  75. data/vcr_cassettes/stats.yml +0 -0
  76. data/vcr_cassettes/suppressions.yml +66 -15
  77. data/vcr_cassettes/templates.yml +1065 -0
  78. data/vcr_cassettes/unsubscribes.yml +0 -0
  79. data/vcr_cassettes/webhooks.yml +0 -0
  80. metadata +49 -29
  81. data/.ruby-version +0 -1
  82. /data/spec/unit/{railgun_spec.rb → railgun/content_type_spec.rb} +0 -0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces
6
6
  body:
7
7
  encoding: US-ASCII
8
- string: address=integration-test-email%40DOMAIN.TEST&code=550&error=Integration%20Test
8
+ string: address=integration-test%2Bemail%40DOMAIN.TEST&code=550&error=Integration%20Test
9
9
  headers:
10
10
  Accept:
11
11
  - "*/*; q=0.5, application/xml"
@@ -42,13 +42,13 @@ http_interactions:
42
42
  - Content-Type, x-requested-with
43
43
  body:
44
44
  encoding: UTF-8
45
- string: '{"address":"integration-test-email@DOMAIN.TEST","message":"Address
45
+ string: '{"address":"integration-test+email@DOMAIN.TEST","message":"Address
46
46
  has been added to the bounces table"}'
47
- http_version:
47
+ http_version:
48
48
  recorded_at: Fri, 08 Jan 2016 20:33:29 GMT
49
49
  - request:
50
50
  method: get
51
- uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/integration-test-email@DOMAIN.TEST
51
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/integration-test+email@DOMAIN.TEST
52
52
  body:
53
53
  encoding: US-ASCII
54
54
  string: ''
@@ -84,9 +84,9 @@ http_interactions:
84
84
  - Content-Type, x-requested-with
85
85
  body:
86
86
  encoding: UTF-8
87
- string: '{"address":"integration-test-email@DOMAIN.TEST","code":"550","error":"Integration
87
+ string: '{"address":"integration-test+email@DOMAIN.TEST","code":"550","error":"Integration
88
88
  Test","created_at":"Fri, 08 Jan 2016 20:33:28 UTC"}'
89
- http_version:
89
+ http_version:
90
90
  recorded_at: Fri, 08 Jan 2016 20:33:29 GMT
91
91
  - request:
92
92
  method: get
@@ -126,13 +126,13 @@ http_interactions:
126
126
  - Content-Type, x-requested-with
127
127
  body:
128
128
  encoding: UTF-8
129
- string: '{"items":[{"address":"integration-test-email@DOMAIN.TEST","code":"550","error":"Integration
130
- Test","created_at":"Fri, 08 Jan 2016 20:33:28 UTC"}],"paging":{"first":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?limit=100","last":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=last\u0026limit=100","next":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=next\u0026address=integration-test-email%40DOMAIN.TEST\u0026limit=100","previous":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=previous\u0026address=integration-test-email%40DOMAIN.TEST\u0026limit=100"}}'
131
- http_version:
129
+ string: '{"items":[{"address":"integration-test+email@DOMAIN.TEST","code":"550","error":"Integration
130
+ Test","created_at":"Fri, 08 Jan 2016 20:33:28 UTC"}],"paging":{"first":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?limit=100","last":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=last\u0026limit=100","next":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=next\u0026address=integration-test%2Bemaill%40DOMAIN.TEST\u0026limit=100","previous":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=previous\u0026address=integration-test%2Bemail%40DOMAIN.TEST\u0026limit=100"}}'
131
+ http_version:
132
132
  recorded_at: Fri, 08 Jan 2016 20:33:29 GMT
133
133
  - request:
134
134
  method: delete
135
- uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/integration-test-email@DOMAIN.TEST
135
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/bounces/integration-test+email@DOMAIN.TEST
136
136
  body:
137
137
  encoding: US-ASCII
138
138
  string: ''
@@ -168,8 +168,8 @@ http_interactions:
168
168
  - Content-Type, x-requested-with
169
169
  body:
170
170
  encoding: UTF-8
171
- string: '{"address":"integration-test-email@DOMAIN.TEST","message":"Bounced
171
+ string: '{"address":"integration-test+email@DOMAIN.TEST","message":"Bounced
172
172
  address has been removed"}'
173
- http_version:
173
+ http_version:
174
174
  recorded_at: Fri, 08 Jan 2016 20:33:30 GMT
175
175
  recorded_with: VCR 3.0.1
File without changes
File without changes
@@ -357,4 +357,54 @@ http_interactions:
357
357
  }
358
358
  http_version:
359
359
  recorded_at: Fri, 15 Jan 2016 20:12:54 GMT
360
- recorded_with: VCR 3.0.1
360
+ - request:
361
+ method: put
362
+ uri: https://api.mailgun.net/v3/domains/integration-test.domain.invalid
363
+ body:
364
+ encoding: UTF-8
365
+ string: spam_action=block&web_scheme=https&wildcard=true
366
+ headers:
367
+ Accept:
368
+ - "*/*"
369
+ User-Agent:
370
+ - rest-client/2.1.0 (darwin21.6.0 x86_64) ruby/2.5.1p57
371
+ Content-Length:
372
+ - '48'
373
+ Content-Type:
374
+ - application/x-www-form-urlencoded
375
+ Accept-Encoding:
376
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
377
+ Host:
378
+ - api.mailgun.net
379
+ Authorization:
380
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
381
+ response:
382
+ status:
383
+ code: 200
384
+ message: OK
385
+ headers:
386
+ Access-Control-Allow-Credentials:
387
+ - 'true'
388
+ Access-Control-Allow-Origin:
389
+ - "*"
390
+ Cache-Control:
391
+ - no-store
392
+ Content-Length:
393
+ - '445'
394
+ Content-Type:
395
+ - application/json; charset=utf-8
396
+ Date:
397
+ - Mon, 17 Apr 2023 13:03:16 GMT
398
+ Strict-Transport-Security:
399
+ - max-age=63072000; includeSubDomains
400
+ X-Xss-Protection:
401
+ - 1; mode=block
402
+ body:
403
+ encoding: UTF-8
404
+ string: '{"message":"Domain has been updated","domain":{"created_at":"Mon, 25
405
+ Jan 2021 10:11:26 GMT","id":"600e994e20b1a14a5990856d","is_disabled":false,"name":"integration-test.domain.invalid","require_tls":false,"skip_verification":false,"smtp_login":"postmaster@DOMAIN.TEST","spam_action":"block","state":"active","type":"sandbox","web_prefix":"email","web_scheme":"https","wildcard":true}}
406
+
407
+ '
408
+ http_version:
409
+ recorded_at: Mon, 17 Apr 2023 13:04:47 GMT
410
+ recorded_with: VCR 3.0.3
@@ -48,11 +48,11 @@ http_interactions:
48
48
  "Alice <alice@example.com>",
49
49
  "bob@example.com"
50
50
  ],
51
- "unparseable": [
51
+ "unparsable": [
52
52
  "example.org"
53
53
  ]
54
54
  }
55
- http_version:
55
+ http_version:
56
56
  recorded_at: Wed, 26 Oct 2016 22:44:50 GMT
57
57
  - request:
58
58
  method: get
@@ -107,7 +107,7 @@ http_interactions:
107
107
  "local_part": "alice"
108
108
  }
109
109
  }
110
- http_version:
110
+ http_version:
111
111
  recorded_at: Wed, 26 Oct 2016 22:44:50 GMT
112
112
  - request:
113
113
  method: get
@@ -162,7 +162,7 @@ http_interactions:
162
162
  "local_part": null
163
163
  }
164
164
  }
165
- http_version:
165
+ http_version:
166
166
  recorded_at: Wed, 26 Oct 2016 22:44:50 GMT
167
167
  - request:
168
168
  method: get
@@ -210,6 +210,6 @@ http_interactions:
210
210
  false, "is_role_address": false, "is_valid": true, "mailbox_verification":
211
211
  "true", "parts": {"display_name": null, "domain": "mailgun.net", "local_part":
212
212
  "alice"}}'
213
- http_version:
213
+ http_version:
214
214
  recorded_at: Tue, 12 Sep 2017 16:55:09 GMT
215
215
  recorded_with: VCR 3.0.3
File without changes
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/messages
6
+ body:
7
+ encoding: UTF-8
8
+ string: from=sally%test.com&to=sally%test.com&subject=Exception+Integration+Test&text=INTEGRATION+TESTING
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (darwin21.6.0 x86_64) ruby/2.5.1p57
14
+ Content-Length:
15
+ - '119'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Host:
21
+ - api.mailgun.net
22
+ Authorization:
23
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2YwNS1mYTQ4MTZhMQ==
24
+ response:
25
+ status:
26
+ code: 401
27
+ message: Unauthorized
28
+ headers:
29
+ Access-Control-Allow-Credentials:
30
+ - 'true'
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Cache-Control:
34
+ - no-store
35
+ Content-Length:
36
+ - '9'
37
+ Content-Type:
38
+ - text/plain; charset=utf-8
39
+ Date:
40
+ - Sun, 28 May 2023 11:29:25 GMT
41
+ Strict-Transport-Security:
42
+ - max-age=63072000; includeSubDomains
43
+ Www-Authenticate:
44
+ - Basic realm="MG API"
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ body:
48
+ encoding: UTF-8
49
+ string: Forbidden
50
+ http_version:
51
+ recorded_at: Sun, 28 May 2023 11:29:25 GMT
52
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/messages
6
+ body:
7
+ encoding: UTF-8
8
+ string: from=sally%40gmail.com&to=sallygmail.com&subject=Exception+Integration+Test&text=INTEGRATION+TESTING
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (darwin21.6.0 x86_64) ruby/2.5.1p57
14
+ Content-Length:
15
+ - '116'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Host:
21
+ - api.mailgun.net
22
+ Authorization:
23
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
24
+ response:
25
+ status:
26
+ code: 400
27
+ message: Bad Request
28
+ headers:
29
+ Access-Control-Allow-Credentials:
30
+ - 'true'
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Cache-Control:
34
+ - no-store
35
+ Content-Length:
36
+ - '78'
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Date:
40
+ - Sun, 28 May 2023 11:35:04 GMT
41
+ Strict-Transport-Security:
42
+ - max-age=63072000; includeSubDomains
43
+ X-Xss-Protection:
44
+ - 1; mode=block
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"message":"to parameter is not a valid address. please check documentation"}
48
+
49
+ '
50
+ http_version:
51
+ recorded_at: Sun, 28 May 2023 11:35:04 GMT
52
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/messages
6
+ body:
7
+ encoding: UTF-8
8
+ string: from=sally%test.com&to=sally%test.com&subject=Exception+Integration+Test&text=INTEGRATION+TESTING
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (darwin21.6.0 x86_64) ruby/2.5.1p57
14
+ Content-Length:
15
+ - '121'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Host:
21
+ - api.mailgun.net
22
+ Authorization:
23
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
24
+ response:
25
+ status:
26
+ code: 403
27
+ message: Forbidden
28
+ headers:
29
+ Access-Control-Allow-Credentials:
30
+ - 'true'
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Cache-Control:
34
+ - no-store
35
+ Content-Length:
36
+ - '219'
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Date:
40
+ - Sun, 28 May 2023 11:40:00 GMT
41
+ Strict-Transport-Security:
42
+ - max-age=63072000; includeSubDomains
43
+ X-Xss-Protection:
44
+ - 1; mode=block
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"message":"Domain DOMAIN.TEST is not allowed to send: Free accounts
48
+ are for test purposes only. Please upgrade or add the address to authorized
49
+ recipients in Account Settings."}
50
+
51
+ '
52
+ http_version:
53
+ recorded_at: Sun, 28 May 2023 11:40:00 GMT
54
+ recorded_with: VCR 3.0.3
File without changes
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailgun.net/v3/not-our-doma.in/messages
6
+ body:
7
+ encoding: US-ASCII
8
+ string: from[]=sally%40not-our-doma.in&subject[]=subject&html[]=%3Cp%3ETest%21%3C%2Fp%3E&text[]=Test%21&to[]=bob%40DOMAIN.TEST&h%3Acontent-type=multipart%2Falternative%3B+boundary%3D%22--%3D%3D_mimepart_6098fb5a12edf_78633ff4e00521889696a%22%3B+charset%3DUTF-8
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (darwin18.7.0 x86_64) ruby/2.2.2p95
14
+ Content-Length:
15
+ - '262'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Host:
21
+ - api.mailgun.net
22
+ Authorization:
23
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
24
+ response:
25
+ status:
26
+ code: 401
27
+ message: UNAUTHORIZED
28
+ headers:
29
+ Access-Control-Allow-Headers:
30
+ - Content-Type, x-requested-with, Authorization
31
+ Access-Control-Allow-Methods:
32
+ - GET, POST, PUT, DELETE, OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Max-Age:
36
+ - '600'
37
+ Cache-Control:
38
+ - no-store
39
+ Content-Type:
40
+ - text/html; charset=utf-8
41
+ Date:
42
+ - Mon, 10 May 2021 09:22:34 GMT
43
+ Server:
44
+ - nginx
45
+ Www-Authenticate:
46
+ - Basic realm="MG API"
47
+ Content-Length:
48
+ - '9'
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: Forbidden
54
+ http_version:
55
+ recorded_at: Mon, 10 May 2021 09:22:34 GMT
56
+ - request:
57
+ method: post
58
+ uri: https://api.mailgun.net/v3/not-our-doma.in/messages
59
+ body:
60
+ encoding: US-ASCII
61
+ string: from[]=sally%40not-our-doma.in&subject[]=subject&html[]=%3Cp%3ETest%21%3C%2Fp%3E&text[]=Test%21&to[]=bob%40DOMAIN.TEST&h%3Acontent-type=multipart%2Falternative%3B+boundary%3D%22--%3D%3D_mimepart_6098fb5a12edf_78633ff4e00521889696a%22%3B+charset%3DUTF-8
62
+ headers:
63
+ Accept:
64
+ - "*/*"
65
+ User-Agent:
66
+ - rest-client/2.1.0 (darwin18.7.0 x86_64) ruby/2.2.2p95
67
+ Content-Length:
68
+ - '262'
69
+ Content-Type:
70
+ - application/x-www-form-urlencoded
71
+ Accept-Encoding:
72
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
73
+ Host:
74
+ - api.mailgun.net
75
+ Authorization:
76
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
77
+ response:
78
+ status:
79
+ code: 401
80
+ message: UNAUTHORIZED
81
+ headers:
82
+ Access-Control-Allow-Headers:
83
+ - Content-Type, x-requested-with, Authorization
84
+ Access-Control-Allow-Methods:
85
+ - GET, POST, PUT, DELETE, OPTIONS
86
+ Access-Control-Allow-Origin:
87
+ - "*"
88
+ Access-Control-Max-Age:
89
+ - '600'
90
+ Cache-Control:
91
+ - no-store
92
+ Content-Type:
93
+ - text/html; charset=utf-8
94
+ Date:
95
+ - Mon, 10 May 2021 09:22:40 GMT
96
+ Server:
97
+ - nginx
98
+ Www-Authenticate:
99
+ - Basic realm="MG API"
100
+ Content-Length:
101
+ - '9'
102
+ Connection:
103
+ - keep-alive
104
+ body:
105
+ encoding: UTF-8
106
+ string: Forbidden
107
+ http_version:
108
+ recorded_at: Mon, 10 May 2021 09:22:40 GMT
109
+ recorded_with: VCR 3.0.3
File without changes
File without changes
@@ -0,0 +1,149 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/messages
6
+ body:
7
+ encoding: US-ASCII
8
+ string: from[]=bob%40DOMAIN.TEST&subject[]=subject&html[]=%3Cp%3ETest%21%3C%2Fp%3E&text[]=Test%21&to[]=bob%40DOMAIN.TEST&h%3Acontent-type=multipart%2Falternative%3B+boundary%3D%22--%3D%3D_mimepart_6098f913d64ca_62833fd4d74521802775%22%3B+charset%3DUTF-8
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (darwin18.7.0 x86_64) ruby/2.2.2p95
14
+ Content-Length:
15
+ - '261'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Host:
21
+ - api.mailgun.net
22
+ Authorization:
23
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Access-Control-Allow-Credentials:
30
+ - 'true'
31
+ Access-Control-Allow-Headers:
32
+ - Content-Type, x-requested-with, Authorization
33
+ Access-Control-Allow-Methods:
34
+ - GET, POST, PUT, DELETE, OPTIONS
35
+ Access-Control-Allow-Origin:
36
+ - "*"
37
+ Access-Control-Max-Age:
38
+ - '600'
39
+ Cache-Control:
40
+ - no-store
41
+ Content-Disposition:
42
+ - inline
43
+ Content-Type:
44
+ - application/json
45
+ Date:
46
+ - Mon, 10 May 2021 09:12:52 GMT
47
+ Server:
48
+ - nginx
49
+ Strict-Transport-Security:
50
+ - max-age=63072000; includeSubDomains
51
+ X-Ratelimit-Limit:
52
+ - '2000000'
53
+ X-Ratelimit-Remaining:
54
+ - '1999999'
55
+ X-Ratelimit-Reset:
56
+ - '1620637982656'
57
+ X-Recipient-Limit:
58
+ - '1000000'
59
+ X-Recipient-Remaining:
60
+ - '999999'
61
+ X-Recipient-Reset:
62
+ - '1620637982657'
63
+ Content-Length:
64
+ - '136'
65
+ Connection:
66
+ - keep-alive
67
+ body:
68
+ encoding: UTF-8
69
+ string: |-
70
+ {
71
+ "id": "<20210510091252.1.D6347B73DA43962E@DOMAIN.TEST>",
72
+ "message": "Queued. Thank you."
73
+ }
74
+ http_version:
75
+ recorded_at: Mon, 10 May 2021 09:12:52 GMT
76
+ - request:
77
+ method: post
78
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/messages
79
+ body:
80
+ encoding: US-ASCII
81
+ string: from[]=bob%40DOMAIN.TEST&subject[]=subject&html[]=%3Cp%3ETest%21%3C%2Fp%3E&text[]=Test%21&to[]=bob%40DOMAIN.TEST&h%3Amessage-id=%3C20210510091252.1.D6347B73DA43962E%40DOMAIN.TEST%3E&h%3Acontent-type=multipart%2Falternative%3B+boundary%3D%22--%3D%3D_mimepart_6098f913d64ca_62833fd4d74521802775%22%3B+charset%3DUTF-8
82
+ headers:
83
+ Accept:
84
+ - "*/*"
85
+ User-Agent:
86
+ - rest-client/2.1.0 (darwin18.7.0 x86_64) ruby/2.2.2p95
87
+ Content-Length:
88
+ - '370'
89
+ Content-Type:
90
+ - application/x-www-form-urlencoded
91
+ Accept-Encoding:
92
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
93
+ Host:
94
+ - api.mailgun.net
95
+ Authorization:
96
+ - Basic YXBpOmQ5MTViNWNkYjlhNTgzNjg1ZDhmM2ZiMWJlYzBmMjBmLTA3YmM3YjA1LWZhNDgxNmEx
97
+ response:
98
+ status:
99
+ code: 200
100
+ message: OK
101
+ headers:
102
+ Access-Control-Allow-Credentials:
103
+ - 'true'
104
+ Access-Control-Allow-Headers:
105
+ - Content-Type, x-requested-with, Authorization
106
+ Access-Control-Allow-Methods:
107
+ - GET, POST, PUT, DELETE, OPTIONS
108
+ Access-Control-Allow-Origin:
109
+ - "*"
110
+ Access-Control-Max-Age:
111
+ - '600'
112
+ Cache-Control:
113
+ - no-store
114
+ Content-Disposition:
115
+ - inline
116
+ Content-Type:
117
+ - application/json
118
+ Date:
119
+ - Mon, 10 May 2021 09:12:56 GMT
120
+ Server:
121
+ - nginx
122
+ Strict-Transport-Security:
123
+ - max-age=63072000; includeSubDomains
124
+ X-Ratelimit-Limit:
125
+ - '2000000'
126
+ X-Ratelimit-Remaining:
127
+ - '1999998'
128
+ X-Ratelimit-Reset:
129
+ - '1620637982656'
130
+ X-Recipient-Limit:
131
+ - '1000000'
132
+ X-Recipient-Remaining:
133
+ - '999998'
134
+ X-Recipient-Reset:
135
+ - '1620637982657'
136
+ Content-Length:
137
+ - '136'
138
+ Connection:
139
+ - keep-alive
140
+ body:
141
+ encoding: UTF-8
142
+ string: |-
143
+ {
144
+ "id": "<20210510091252.1.D6347B73DA43962E@DOMAIN.TEST>",
145
+ "message": "Queued. Thank you."
146
+ }
147
+ http_version:
148
+ recorded_at: Mon, 10 May 2021 09:12:56 GMT
149
+ recorded_with: VCR 3.0.3
File without changes
File without changes
File without changes