mailgun-ruby 1.4.5 → 1.4.6

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -1
  3. data/README.md +3 -1
  4. data/lib/mailgun/api_keys/api_keys.rb +2 -2
  5. data/lib/mailgun/client.rb +1 -1
  6. data/lib/mailgun/domains/domain_keys.rb +5 -5
  7. data/lib/mailgun/domains/domains.rb +12 -9
  8. data/lib/mailgun/events/events.rb +1 -1
  9. data/lib/mailgun/helpers/api_version_checker.rb +23 -12
  10. data/lib/mailgun/helpers/deprecation.rb +32 -0
  11. data/lib/mailgun/lists/mailing_lists.rb +250 -0
  12. data/lib/mailgun/messages/message_builder.rb +17 -7
  13. data/lib/mailgun/response.rb +1 -1
  14. data/lib/mailgun/routes/routes.rb +98 -0
  15. data/lib/mailgun/tags/analytics_tags.rb +2 -2
  16. data/lib/mailgun/tags/tags.rb +16 -8
  17. data/lib/mailgun/version.rb +1 -1
  18. data/lib/mailgun/webhooks/account_webhooks.rb +2 -2
  19. data/lib/mailgun/webhooks/webhooks.rb +17 -9
  20. data/lib/mailgun.rb +1 -0
  21. metadata +6 -326
  22. data/.github/workflows/ci.yml +0 -49
  23. data/.github_changelog_generator +0 -1
  24. data/.gitignore +0 -24
  25. data/.rubocop.yml +0 -68
  26. data/.ruby-env.yml.example +0 -13
  27. data/Gemfile +0 -9
  28. data/Rakefile +0 -32
  29. data/docs/AccountWebhooks.md +0 -55
  30. data/docs/AnalyticsTags.md +0 -63
  31. data/docs/ApiKeys.md +0 -65
  32. data/docs/DomainKeys.md +0 -49
  33. data/docs/Domains.md +0 -82
  34. data/docs/EmailValidation.md +0 -34
  35. data/docs/Events.md +0 -48
  36. data/docs/Logs.md +0 -67
  37. data/docs/MessageBuilder.md +0 -120
  38. data/docs/Metrics.md +0 -108
  39. data/docs/OptInHandler.md +0 -103
  40. data/docs/Snippets.md +0 -519
  41. data/docs/Subaccounts.md +0 -68
  42. data/docs/Suppressions.md +0 -92
  43. data/docs/Templates.md +0 -92
  44. data/docs/Webhooks.md +0 -65
  45. data/docs/railgun/EmailValidation.md +0 -34
  46. data/docs/railgun/Overview.md +0 -11
  47. data/docs/railgun/Parameters.md +0 -83
  48. data/mailgun.gemspec +0 -47
  49. data/spec/integration/account_webhooks_spec.rb +0 -57
  50. data/spec/integration/analytics_tags_spec.rb +0 -54
  51. data/spec/integration/api_keys_spec.rb +0 -50
  52. data/spec/integration/bounces_spec.rb +0 -45
  53. data/spec/integration/campaign_spec.rb +0 -62
  54. data/spec/integration/complaints_spec.rb +0 -40
  55. data/spec/integration/domain_keys_spec.rb +0 -124
  56. data/spec/integration/domains_spec.rb +0 -201
  57. data/spec/integration/email_validation_spec.rb +0 -73
  58. data/spec/integration/events_spec.rb +0 -28
  59. data/spec/integration/list_members_spec.rb +0 -64
  60. data/spec/integration/list_spec.rb +0 -59
  61. data/spec/integration/logs_spec.rb +0 -105
  62. data/spec/integration/mailer_spec.rb +0 -65
  63. data/spec/integration/mailgun_spec.rb +0 -198
  64. data/spec/integration/messages/sample_data/mime.txt +0 -38
  65. data/spec/integration/metrics_spec.rb +0 -224
  66. data/spec/integration/routes_spec.rb +0 -91
  67. data/spec/integration/stats_spec.rb +0 -17
  68. data/spec/integration/subaccounts_spec.rb +0 -57
  69. data/spec/integration/suppressions_spec.rb +0 -320
  70. data/spec/integration/templates_spec.rb +0 -137
  71. data/spec/integration/unsubscribes_spec.rb +0 -44
  72. data/spec/integration/webhook_spec.rb +0 -79
  73. data/spec/spec_helper.rb +0 -53
  74. data/spec/unit/client_spec.rb +0 -448
  75. data/spec/unit/connection/test_client.rb +0 -169
  76. data/spec/unit/events/events_spec.rb +0 -88
  77. data/spec/unit/exceptions/exceptions_spec.rb +0 -31
  78. data/spec/unit/helpers/api_version_checker_spec.rb +0 -206
  79. data/spec/unit/lists/opt_in_handler_spec.rb +0 -28
  80. data/spec/unit/mailgun_spec.rb +0 -171
  81. data/spec/unit/messages/batch_message_spec.rb +0 -148
  82. data/spec/unit/messages/message_builder_spec.rb +0 -745
  83. data/spec/unit/messages/sample_data/mailgun_icon.png +0 -0
  84. data/spec/unit/messages/sample_data/mime.txt +0 -38
  85. data/spec/unit/messages/sample_data/rackspace_logo.jpg +0 -0
  86. data/spec/unit/messages/sample_data/unknown.type +0 -0
  87. data/spec/unit/railgun/content_type_spec.rb +0 -89
  88. data/spec/unit/railgun/mailer_spec.rb +0 -391
  89. data/spec/unit/response_spec.rb +0 -225
  90. data/spec/unit/webhooks_spec.rb +0 -121
  91. data/vcr_cassettes/For_the_suppressions_handling_class/creates_a_single_bounce.yml +0 -55
  92. data/vcr_cassettes/account_webhooks.yml +0 -269
  93. data/vcr_cassettes/analytics_tags.yml +0 -187
  94. data/vcr_cassettes/api_keys.yml +0 -212
  95. data/vcr_cassettes/bounces.yml +0 -136
  96. data/vcr_cassettes/complaints.yml +0 -315
  97. data/vcr_cassettes/domains.todo.yml +0 -42
  98. data/vcr_cassettes/domains.yml +0 -1243
  99. data/vcr_cassettes/email_validation.yml +0 -152
  100. data/vcr_cassettes/events.yml +0 -69
  101. data/vcr_cassettes/exceptions-invalid-api-key.yml +0 -52
  102. data/vcr_cassettes/exceptions-invalid-data.yml +0 -52
  103. data/vcr_cassettes/exceptions-not-allowed.yml +0 -54
  104. data/vcr_cassettes/exceptions.yml +0 -92
  105. data/vcr_cassettes/list_members.yml +0 -328
  106. data/vcr_cassettes/logs.yml +0 -53
  107. data/vcr_cassettes/mailer_invalid_domain.yml +0 -109
  108. data/vcr_cassettes/mailing_list.todo.yml +0 -43
  109. data/vcr_cassettes/mailing_list.yml +0 -682
  110. data/vcr_cassettes/message_deliver.yml +0 -149
  111. data/vcr_cassettes/metrics.yml +0 -116
  112. data/vcr_cassettes/routes.yml +0 -359
  113. data/vcr_cassettes/send_message.yml +0 -158
  114. data/vcr_cassettes/stats.yml +0 -48
  115. data/vcr_cassettes/subaccounts.yml +0 -270
  116. data/vcr_cassettes/suppressions.yml +0 -1392
  117. data/vcr_cassettes/templates.yml +0 -1065
  118. data/vcr_cassettes/unsubscribes.yml +0 -401
  119. data/vcr_cassettes/webhooks.yml +0 -246
  120. data/vcr_cassettes/webhooks_v4.yml +0 -275
@@ -1,158 +0,0 @@
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
- - request:
108
- method: post
109
- uri: https://api.mailgun.net/v3/DOMAIN.TEST/messages
110
- body:
111
- encoding: UTF-8
112
- string: from=bob%40DOMAIN.TEST&o%3Atestmode=true&subject=Hash+Integration+Test&text=INTEGRATION+TESTING&to=sally%40DOMAIN.TEST
113
- headers:
114
- User-Agent:
115
- - mailgun-sdk-ruby/1.3.0
116
- Accept:
117
- - "*/*"
118
- Authorization:
119
- - Basic xxx==
120
- Content-Type:
121
- - application/x-www-form-urlencoded
122
- Accept-Encoding:
123
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
124
- response:
125
- status:
126
- code: 403
127
- message: Forbidden
128
- headers:
129
- Access-Control-Allow-Credentials:
130
- - 'true'
131
- Access-Control-Allow-Origin:
132
- - "*"
133
- Cache-Control:
134
- - no-store
135
- Content-Length:
136
- - '236'
137
- Content-Type:
138
- - application/json; charset=utf-8
139
- Date:
140
- - Sun, 26 Jan 2025 07:29:31 GMT
141
- Strict-Transport-Security:
142
- - max-age=63072000; includeSubDomains
143
- X-Mailgun-Key-Id:
144
- - 90b59dea-f2d12a53
145
- X-Server:
146
- - influx
147
- X-Xss-Protection:
148
- - 1; mode=block
149
- body:
150
- encoding: UTF-8
151
- string: '{"message":"Domain DOMAIN.TEST is not allowed to send: Sandbox subdomains
152
- are for test purposes only. Please add your own domain or add the address
153
- to authorized recipients in Account Settings."}
154
-
155
- '
156
- http_version:
157
- recorded_at: Sun, 26 Jan 2025 07:29:31 GMT
158
- recorded_with: VCR 3.0.3
@@ -1,48 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.mailgun.net/v3/DOMAIN.TEST/stats?event=sent&limit=50&skip=10
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - mailgun-sdk-ruby/1.3.0
12
- Accept:
13
- - "*/*"
14
- Authorization:
15
- - Basic xxx==
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Access-Control-Allow-Credentials:
24
- - 'true'
25
- Access-Control-Allow-Origin:
26
- - "*"
27
- Cache-Control:
28
- - no-store
29
- Content-Length:
30
- - '19'
31
- Content-Type:
32
- - text/plain; charset=utf-8
33
- Date:
34
- - Sun, 26 Jan 2025 07:29:36 GMT
35
- Strict-Transport-Security:
36
- - max-age=63072000; includeSubDomains
37
- X-Content-Type-Options:
38
- - nosniff
39
- X-Xss-Protection:
40
- - 1; mode=block
41
- body:
42
- encoding: UTF-8
43
- string: '{"items":[],"total_count":10000}
44
-
45
- '
46
- http_version:
47
- recorded_at: Sun, 26 Jan 2025 07:29:36 GMT
48
- recorded_with: VCR 3.0.3
@@ -1,270 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.mailgun.net/v5/accounts/subaccounts
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin22 x86_64) ruby/2.7.4p191
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - api.mailgun.net
18
- Authorization:
19
- - Basic xxx
20
- response:
21
- status:
22
- code: 200
23
- message: OK
24
- headers:
25
- Access-Control-Allow-Credentials:
26
- - 'true'
27
- Access-Control-Allow-Origin:
28
- - "*"
29
- Cache-Control:
30
- - no-store
31
- Content-Disposition:
32
- - inline
33
- Content-Length:
34
- - '706'
35
- Content-Type:
36
- - application/json
37
- Date:
38
- - Mon, 20 Nov 2023 15:30:55 GMT
39
- Server:
40
- - TwistedWeb/23.10.0
41
- Strict-Transport-Security:
42
- - max-age=63072000; includeSubDomains
43
- X-Mailgun-Key-Id:
44
- - 1c7e8847-e7fad6d2
45
- X-Xss-Protection:
46
- - 1; mode=block
47
- body:
48
- encoding: UTF-8
49
- string: '{"subaccounts":[{"id":"xxx","name":"test-ruby-lib","status":"open"}],"total":1}
50
-
51
- '
52
- http_version:
53
- recorded_at: Mon, 20 Nov 2023 15:30:55 GMT
54
- - request:
55
- method: post
56
- uri: https://api.mailgun.net/v5/accounts/subaccounts
57
- body:
58
- encoding: UTF-8
59
- string: name=test.subaccount
60
- headers:
61
- Accept:
62
- - "*/*"
63
- User-Agent:
64
- - rest-client/2.1.0 (darwin22 x86_64) ruby/2.7.4p191
65
- Content-Length:
66
- - '20'
67
- Content-Type:
68
- - application/x-www-form-urlencoded
69
- Accept-Encoding:
70
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
- Host:
72
- - api.mailgun.net
73
- Authorization:
74
- - Basic xxx
75
- response:
76
- status:
77
- code: 200
78
- message: OK
79
- headers:
80
- Access-Control-Allow-Credentials:
81
- - 'true'
82
- Access-Control-Allow-Origin:
83
- - "*"
84
- Cache-Control:
85
- - no-store
86
- Content-Disposition:
87
- - inline
88
- Content-Length:
89
- - '90'
90
- Content-Type:
91
- - application/json
92
- Date:
93
- - Mon, 20 Nov 2023 15:33:05 GMT
94
- Server:
95
- - TwistedWeb/23.10.0
96
- Strict-Transport-Security:
97
- - max-age=63072000; includeSubDomains
98
- X-Mailgun-Key-Id:
99
- - 1c7e8847-e7fad6d2
100
- X-Xss-Protection:
101
- - 1; mode=block
102
- body:
103
- encoding: UTF-8
104
- string: '{"subaccount":{"id":"xxx","name":"test.subaccount","status":"open"}}
105
-
106
- '
107
- http_version:
108
- recorded_at: Mon, 20 Nov 2023 15:33:05 GMT
109
- - request:
110
- method: get
111
- uri: https://api.mailgun.net/v5/accounts/subaccounts/xxx
112
- body:
113
- encoding: US-ASCII
114
- string: ''
115
- headers:
116
- Accept:
117
- - "*/*"
118
- User-Agent:
119
- - rest-client/2.1.0 (darwin22 x86_64) ruby/2.7.4p191
120
- Accept-Encoding:
121
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
122
- Host:
123
- - api.mailgun.net
124
- Authorization:
125
- - Basic xxx
126
- response:
127
- status:
128
- code: 200
129
- message: OK
130
- headers:
131
- Access-Control-Allow-Credentials:
132
- - 'true'
133
- Access-Control-Allow-Origin:
134
- - "*"
135
- Cache-Control:
136
- - no-store
137
- Content-Disposition:
138
- - inline
139
- Content-Length:
140
- - '88'
141
- Content-Type:
142
- - application/json
143
- Date:
144
- - Mon, 20 Nov 2023 15:33:06 GMT
145
- Server:
146
- - TwistedWeb/23.10.0
147
- Strict-Transport-Security:
148
- - max-age=63072000; includeSubDomains
149
- X-Mailgun-Key-Id:
150
- - 1c7e8847-e7fad6d2
151
- X-Xss-Protection:
152
- - 1; mode=block
153
- body:
154
- encoding: UTF-8
155
- string: '{"subaccount":{"id":"xxx","name":"test-ruby-lib","status":"open"}}
156
-
157
- '
158
- http_version:
159
- recorded_at: Mon, 20 Nov 2023 15:33:06 GMT
160
- - request:
161
- method: post
162
- uri: https://api.mailgun.net/v5/accounts/subaccounts/xxx/enable
163
- body:
164
- encoding: US-ASCII
165
- string: ''
166
- headers:
167
- Accept:
168
- - "*/*"
169
- User-Agent:
170
- - rest-client/2.1.0 (darwin22 x86_64) ruby/2.7.4p191
171
- Content-Length:
172
- - '0'
173
- Content-Type:
174
- - application/x-www-form-urlencoded
175
- Accept-Encoding:
176
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
177
- Host:
178
- - api.mailgun.net
179
- Authorization:
180
- - Basic xxx
181
- response:
182
- status:
183
- code: 200
184
- message: OK
185
- headers:
186
- Access-Control-Allow-Credentials:
187
- - 'true'
188
- Access-Control-Allow-Origin:
189
- - "*"
190
- Cache-Control:
191
- - no-store
192
- Content-Disposition:
193
- - inline
194
- Content-Length:
195
- - '88'
196
- Content-Type:
197
- - application/json
198
- Date:
199
- - Mon, 20 Nov 2023 15:33:06 GMT
200
- Server:
201
- - TwistedWeb/23.10.0
202
- Strict-Transport-Security:
203
- - max-age=63072000; includeSubDomains
204
- X-Mailgun-Key-Id:
205
- - 1c7e8847-e7fad6d2
206
- X-Xss-Protection:
207
- - 1; mode=block
208
- body:
209
- encoding: UTF-8
210
- string: '{"subaccount":{"id":"xxx","name":"test-ruby-lib","status":"open"}}
211
-
212
- '
213
- http_version:
214
- recorded_at: Mon, 20 Nov 2023 15:33:06 GMT
215
- - request:
216
- method: post
217
- uri: https://api.mailgun.net/v5/accounts/subaccounts/xxx/disable
218
- body:
219
- encoding: US-ASCII
220
- string: ''
221
- headers:
222
- Accept:
223
- - "*/*"
224
- User-Agent:
225
- - rest-client/2.1.0 (darwin22 x86_64) ruby/2.7.4p191
226
- Content-Length:
227
- - '0'
228
- Content-Type:
229
- - application/x-www-form-urlencoded
230
- Accept-Encoding:
231
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
232
- Host:
233
- - api.mailgun.net
234
- Authorization:
235
- - Basic xxx
236
- response:
237
- status:
238
- code: 200
239
- message: OK
240
- headers:
241
- Access-Control-Allow-Credentials:
242
- - 'true'
243
- Access-Control-Allow-Origin:
244
- - "*"
245
- Cache-Control:
246
- - no-store
247
- Content-Disposition:
248
- - inline
249
- Content-Length:
250
- - '92'
251
- Content-Type:
252
- - application/json
253
- Date:
254
- - Mon, 20 Nov 2023 15:33:07 GMT
255
- Server:
256
- - TwistedWeb/23.10.0
257
- Strict-Transport-Security:
258
- - max-age=63072000; includeSubDomains
259
- X-Mailgun-Key-Id:
260
- - 1c7e8847-e7fad6d2
261
- X-Xss-Protection:
262
- - 1; mode=block
263
- body:
264
- encoding: UTF-8
265
- string: '{"subaccount":{"id":"xxx","name":"test-ruby-lib","status":"disabled"}}
266
-
267
- '
268
- http_version:
269
- recorded_at: Mon, 20 Nov 2023 15:33:08 GMT
270
- recorded_with: VCR 3.0.3