mailgun-ruby 1.2.5 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) 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/README.md +4 -2
  6. data/docs/Domains.md +3 -0
  7. data/docs/OptInHandler.md +1 -1
  8. data/docs/Snippets.md +54 -61
  9. data/docs/railgun/Templates.md +92 -0
  10. data/lib/mailgun/address.rb +3 -28
  11. data/lib/mailgun/chains.rb +0 -0
  12. data/lib/mailgun/client.rb +20 -6
  13. data/lib/mailgun/domains/domains.rb +19 -1
  14. data/lib/mailgun/exceptions/exceptions.rb +27 -2
  15. data/lib/mailgun/messages/message_builder.rb +2 -2
  16. data/lib/mailgun/response.rb +0 -0
  17. data/lib/mailgun/suppressions.rb +11 -7
  18. data/lib/mailgun/version.rb +1 -1
  19. data/lib/mailgun/webhooks/webhooks.rb +2 -2
  20. data/lib/mailgun-ruby.rb +1 -1
  21. data/lib/mailgun.rb +3 -1
  22. data/lib/railgun/mailer.rb +4 -1
  23. data/spec/integration/bounces_spec.rb +3 -3
  24. data/spec/integration/campaign_spec.rb +0 -0
  25. data/spec/integration/complaints_spec.rb +0 -0
  26. data/spec/integration/domains_spec.rb +8 -0
  27. data/spec/integration/email_validation_spec.rb +1 -8
  28. data/spec/integration/events_spec.rb +0 -0
  29. data/spec/integration/list_members_spec.rb +0 -0
  30. data/spec/integration/list_spec.rb +0 -0
  31. data/spec/integration/mailgun_spec.rb +72 -0
  32. data/spec/integration/routes_spec.rb +0 -0
  33. data/spec/integration/stats_spec.rb +0 -0
  34. data/spec/integration/suppressions_spec.rb +0 -0
  35. data/spec/integration/unsubscribes_spec.rb +0 -0
  36. data/spec/integration/webhook_spec.rb +0 -0
  37. data/spec/unit/connection/test_client.rb +4 -3
  38. data/spec/unit/mailgun_spec.rb +19 -0
  39. data/vcr_cassettes/bounces.yml +12 -12
  40. data/vcr_cassettes/complaints.yml +0 -0
  41. data/vcr_cassettes/domains.todo.yml +0 -0
  42. data/vcr_cassettes/domains.yml +51 -1
  43. data/vcr_cassettes/events.yml +0 -0
  44. data/vcr_cassettes/exceptions-invalid-api-key.yml +52 -0
  45. data/vcr_cassettes/exceptions-invalid-data.yml +52 -0
  46. data/vcr_cassettes/exceptions-not-allowed.yml +54 -0
  47. data/vcr_cassettes/list_members.yml +0 -0
  48. data/vcr_cassettes/mailing_list.todo.yml +0 -0
  49. data/vcr_cassettes/mailing_list.yml +0 -0
  50. data/vcr_cassettes/routes.yml +0 -0
  51. data/vcr_cassettes/send_message.yml +0 -0
  52. data/vcr_cassettes/stats.yml +0 -0
  53. data/vcr_cassettes/unsubscribes.yml +0 -0
  54. data/vcr_cassettes/webhooks.yml +0 -0
  55. metadata +6 -2
@@ -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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailgun-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mailgun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-10 00:00:00.000000000 Z
12
+ date: 2023-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -162,6 +162,7 @@ files:
162
162
  - docs/Webhooks.md
163
163
  - docs/railgun/Overview.md
164
164
  - docs/railgun/Parameters.md
165
+ - docs/railgun/Templates.md
165
166
  - lib/mailgun-ruby.rb
166
167
  - lib/mailgun.rb
167
168
  - lib/mailgun/address.rb
@@ -219,6 +220,9 @@ files:
219
220
  - vcr_cassettes/domains.yml
220
221
  - vcr_cassettes/email_validation.yml
221
222
  - vcr_cassettes/events.yml
223
+ - vcr_cassettes/exceptions-invalid-api-key.yml
224
+ - vcr_cassettes/exceptions-invalid-data.yml
225
+ - vcr_cassettes/exceptions-not-allowed.yml
222
226
  - vcr_cassettes/exceptions.yml
223
227
  - vcr_cassettes/list_members.yml
224
228
  - vcr_cassettes/mailer_invalid_domain.yml