mailgun-ruby 1.4.0 → 1.4.2

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -3
  3. data/Gemfile +3 -1
  4. data/README.md +1 -1
  5. data/Rakefile +5 -3
  6. data/docs/AnalyticsTags.md +63 -0
  7. data/docs/Domains.md +71 -18
  8. data/docs/MessageBuilder.md +1 -1
  9. data/lib/mailgun/address.rb +4 -6
  10. data/lib/mailgun/chains.rb +2 -3
  11. data/lib/mailgun/client.rb +71 -60
  12. data/lib/mailgun/domains/domains.rb +10 -96
  13. data/lib/mailgun/events/events.rb +3 -4
  14. data/lib/mailgun/exceptions/exceptions.rb +14 -15
  15. data/lib/mailgun/helpers/api_version_checker.rb +6 -1
  16. data/lib/mailgun/lists/opt_in_handler.rb +3 -8
  17. data/lib/mailgun/logs/logs.rb +3 -3
  18. data/lib/mailgun/messages/batch_message.rb +7 -10
  19. data/lib/mailgun/messages/message_builder.rb +35 -27
  20. data/lib/mailgun/metrics/metrics.rb +5 -5
  21. data/lib/mailgun/response.rb +11 -9
  22. data/lib/mailgun/subaccounts/subaccounts.rb +12 -9
  23. data/lib/mailgun/suppressions.rb +37 -48
  24. data/lib/mailgun/tags/analytics_tags.rb +63 -0
  25. data/lib/mailgun/tags/tags.rb +35 -18
  26. data/lib/mailgun/templates/templates.rb +39 -30
  27. data/lib/mailgun/version.rb +3 -1
  28. data/lib/mailgun/webhooks/webhooks.rb +22 -19
  29. data/lib/mailgun-ruby.rb +4 -2
  30. data/lib/mailgun.rb +37 -21
  31. data/lib/railgun/attachment.rb +9 -14
  32. data/lib/railgun/errors.rb +2 -3
  33. data/lib/railgun/mailer.rb +34 -44
  34. data/lib/railgun/railtie.rb +10 -1
  35. data/lib/railgun.rb +14 -5
  36. data/mailgun.gemspec +15 -14
  37. data/spec/integration/analytics_tags_spec.rb +54 -0
  38. data/spec/integration/bounces_spec.rb +12 -11
  39. data/spec/integration/campaign_spec.rb +20 -18
  40. data/spec/integration/complaints_spec.rb +8 -6
  41. data/spec/integration/domains_spec.rb +220 -194
  42. data/spec/integration/email_validation_spec.rb +35 -34
  43. data/spec/integration/events_spec.rb +7 -5
  44. data/spec/integration/list_members_spec.rb +27 -26
  45. data/spec/integration/list_spec.rb +22 -21
  46. data/spec/integration/logs_spec.rb +48 -46
  47. data/spec/integration/mailer_spec.rb +7 -3
  48. data/spec/integration/mailgun_spec.rb +82 -90
  49. data/spec/integration/metrics_spec.rb +130 -130
  50. data/spec/integration/routes_spec.rb +41 -40
  51. data/spec/integration/stats_spec.rb +4 -2
  52. data/spec/integration/subaccounts_spec.rb +9 -10
  53. data/spec/integration/suppressions_spec.rb +21 -20
  54. data/spec/integration/templates_spec.rb +14 -12
  55. data/spec/integration/unsubscribes_spec.rb +8 -6
  56. data/spec/integration/webhook_spec.rb +13 -12
  57. data/spec/spec_helper.rb +8 -12
  58. data/spec/unit/connection/test_client.rb +61 -55
  59. data/spec/unit/events/events_spec.rb +25 -22
  60. data/spec/unit/exceptions/exceptions_spec.rb +8 -7
  61. data/spec/unit/lists/opt_in_handler_spec.rb +8 -6
  62. data/spec/unit/mailgun_spec.rb +64 -63
  63. data/spec/unit/messages/batch_message_spec.rb +15 -15
  64. data/spec/unit/messages/message_builder_spec.rb +98 -94
  65. data/spec/unit/railgun/content_type_spec.rb +24 -23
  66. data/spec/unit/railgun/mailer_spec.rb +58 -58
  67. data/vcr_cassettes/analytics_tags.yml +187 -0
  68. data/vcr_cassettes/domains.yml +152 -0
  69. metadata +73 -46
  70. data/.rubocop.yml +0 -8
  71. data/.rubocop_todo.yml +0 -22
  72. data/lib/railgun/message.rb +0 -18
  73. data/spec/integration/tags.rb +0 -139
  74. data/vcr_cassettes/tags.yml +0 -417
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'logger'
3
5
  require 'spec_helper'
@@ -15,42 +17,40 @@ class UnitTestMailer < ActionMailer::Base
15
17
  def plain_message(address, subject, headers)
16
18
  headers(headers)
17
19
  mail(to: address, subject: subject) do |format|
18
- format.text { render plain: "Test!" }
19
- format.html { render html: "<p>Test!</p>".html_safe }
20
+ format.text { render plain: 'Test!' }
21
+ format.html { render html: '<p>Test!</p>'.html_safe }
20
22
  end
21
23
  end
22
24
 
23
25
  def message_with_attachment(address, subject)
24
26
  attachments['info.txt'] = {
25
- :content => File.read('docs/railgun/Overview.md'),
26
- :mime_type => 'text/plain',
27
+ content: File.read('docs/railgun/Overview.md'),
28
+ mime_type: 'text/plain'
27
29
  }
28
30
  mail(to: address, subject: subject) do |format|
29
- format.text { render plain: "Test!" }
30
- format.html { render html: "<p>Test!</p>".html_safe }
31
+ format.text { render plain: 'Test!' }
32
+ format.html { render html: '<p>Test!</p>'.html_safe }
31
33
  end
32
34
  end
33
35
 
34
36
  def message_with_template(address, subject, template_name)
35
37
  mail(to: address, subject: subject, template: template_name) do |format|
36
- format.text { render plain: "Test!" }
38
+ format.text { render plain: 'Test!' }
37
39
  end
38
40
  end
39
41
 
40
42
  def message_with_domain(address, subject, domain)
41
43
  mail(to: address, subject: subject, domain: domain) do |format|
42
- format.text { render plain: "Test!" }
44
+ format.text { render plain: 'Test!' }
43
45
  end
44
46
  end
45
-
46
47
  end
47
48
 
48
49
  describe 'Railgun::Mailer' do
49
-
50
50
  it 'has a mailgun_client property which returns a Mailgun::Client' do
51
51
  config = {
52
- api_key: {},
53
- domain: {}
52
+ api_key: {},
53
+ domain: {}
54
54
  }
55
55
  @mailer_obj = Railgun::Mailer.new(config)
56
56
 
@@ -60,18 +60,18 @@ describe 'Railgun::Mailer' do
60
60
  context 'when config does not have api_key or domain' do
61
61
  it 'raises configuration error' do
62
62
  config = {
63
- api_key: {}
63
+ api_key: {}
64
64
  }
65
65
 
66
- expect { Railgun::Mailer.new(config) }.to raise_error(Railgun::ConfigurationError)
66
+ expect { Railgun::Mailer.new(config) }.to raise_error(Railgun::ConfigurationError)
67
67
  end
68
68
  end
69
69
 
70
70
  context 'when fake_message_send is present in config' do
71
71
  it 'enables test mode' do
72
72
  config = {
73
- api_key: {},
74
- domain: {},
73
+ api_key: {},
74
+ domain: {},
75
75
  fake_message_send: true
76
76
  }
77
77
  client_double = double(Mailgun::Client)
@@ -100,7 +100,7 @@ describe 'Railgun::Mailer' do
100
100
  it 'adds options to message body' do
101
101
  message = UnitTestMailer.plain_message('test@example.org', '', {})
102
102
  message.mailgun_options ||= {
103
- 'tracking-opens' => 'true',
103
+ 'tracking-opens' => 'true'
104
104
  }
105
105
 
106
106
  body = Railgun.transform_for_mailgun(message)
@@ -124,14 +124,14 @@ describe 'Railgun::Mailer' do
124
124
  it 'adds variables to message body' do
125
125
  message = UnitTestMailer.plain_message('test@example.org', '', {})
126
126
  message.mailgun_variables ||= {
127
- 'user' => {:id => '1', :name => 'tstark'},
127
+ 'user' => { id: '1', name: 'tstark' }
128
128
  }
129
129
 
130
130
  body = Railgun.transform_for_mailgun(message)
131
131
 
132
132
  expect(body).to include('v:user')
133
133
 
134
- var_body = JSON.load(body['v:user'])
134
+ var_body = JSON.parse(body['v:user'])
135
135
  expect(var_body).to include('id')
136
136
  expect(var_body).to include('name')
137
137
  expect(var_body['id']).to eq('1')
@@ -141,7 +141,7 @@ describe 'Railgun::Mailer' do
141
141
  it 'adds headers to message body' do
142
142
  message = UnitTestMailer.plain_message('test@example.org', '', {})
143
143
  message.mailgun_headers ||= {
144
- 'x-unit-test' => 'true',
144
+ 'x-unit-test' => 'true'
145
145
  }
146
146
 
147
147
  body = Railgun.transform_for_mailgun(message)
@@ -152,8 +152,8 @@ describe 'Railgun::Mailer' do
152
152
 
153
153
  it 'adds headers to message body from mailer' do
154
154
  message = UnitTestMailer.plain_message('test@example.org', '', {
155
- 'x-unit-test-2' => 'true',
156
- })
155
+ 'x-unit-test-2' => 'true'
156
+ })
157
157
 
158
158
  body = Railgun.transform_for_mailgun(message)
159
159
 
@@ -163,20 +163,20 @@ describe 'Railgun::Mailer' do
163
163
 
164
164
  it 'properly handles headers that are passed as separate POST params' do
165
165
  message = UnitTestMailer.plain_message('test@example.org', 'Test!', {
166
- # `From`, `To`, and `Subject` are set on the envelope, so they should be ignored as headers
167
- 'From' => 'units@example.net',
168
- 'To' => 'user@example.com',
169
- 'Subject' => 'This should disappear',
170
- # If `Bcc` or `Cc` are set as headers, they should be carried over as POST params, not headers
171
- 'Bcc' => ['list@example.org'],
172
- 'Cc' => ['admin@example.com'],
173
- # This is an arbitrary header and should be carried over properly
174
- 'X-Source' => 'unit tests',
175
- })
166
+ # `From`, `To`, and `Subject` are set on the envelope, so they should be ignored as headers
167
+ 'From' => 'units@example.net',
168
+ 'To' => 'user@example.com',
169
+ 'Subject' => 'This should disappear',
170
+ # If `Bcc` or `Cc` are set as headers, they should be carried over as POST params, not headers
171
+ 'Bcc' => ['list@example.org'],
172
+ 'Cc' => ['admin@example.com'],
173
+ # This is an arbitrary header and should be carried over properly
174
+ 'X-Source' => 'unit tests'
175
+ })
176
176
 
177
177
  body = Railgun.transform_for_mailgun(message)
178
178
 
179
- ['From', 'To', 'Subject'].each do |header|
179
+ %w[From To Subject].each do |header|
180
180
  expect(body).not_to include("h:#{header}")
181
181
  end
182
182
 
@@ -202,20 +202,20 @@ describe 'Railgun::Mailer' do
202
202
  }
203
203
  end
204
204
  body = Railgun.transform_for_mailgun(message)
205
- expect(body["v:my-data"]).to be_kind_of(String)
206
- expect(body["v:my-data"].to_s).to eq('{"key":"value"}')
205
+ expect(body['v:my-data']).to be_kind_of(String)
206
+ expect(body['v:my-data'].to_s).to eq('{"key":"value"}')
207
207
  end
208
208
 
209
209
  it 'accepts a hash and appends as data to the message.' do
210
210
  message = UnitTestMailer.plain_message('test@example.org', '', {}).tap do |message|
211
211
  message.mailgun_variables = {
212
- 'my-data' => {'key' => 'value'}
212
+ 'my-data' => { 'key' => 'value' }
213
213
  }
214
214
  end
215
215
  body = Railgun.transform_for_mailgun(message)
216
216
 
217
- expect(body["v:my-data"]).to be_kind_of(String)
218
- expect(body["v:my-data"].to_s).to eq('{"key":"value"}')
217
+ expect(body['v:my-data']).to be_kind_of(String)
218
+ expect(body['v:my-data'].to_s).to eq('{"key":"value"}')
219
219
  end
220
220
 
221
221
  it 'accepts string values' do
@@ -226,8 +226,8 @@ describe 'Railgun::Mailer' do
226
226
  end
227
227
  body = Railgun.transform_for_mailgun(message)
228
228
 
229
- expect(body["v:my-data"]).to be_kind_of(String)
230
- expect(body["v:my-data"].to_s).to eq('String Value.')
229
+ expect(body['v:my-data']).to be_kind_of(String)
230
+ expect(body['v:my-data'].to_s).to eq('String Value.')
231
231
  end
232
232
  end
233
233
 
@@ -251,13 +251,13 @@ describe 'Railgun::Mailer' do
251
251
 
252
252
  it 'ignores `reply-to` in headers' do
253
253
  message = UnitTestMailer.plain_message('test@example.org', '', {
254
- 'reply-to' => 'user@example.com',
255
- })
254
+ 'reply-to' => 'user@example.com'
255
+ })
256
256
  message.mailgun_headers = {
257
- 'Reply-To' => 'administrator@example.org',
257
+ 'Reply-To' => 'administrator@example.org'
258
258
  }
259
- message.headers({'REPLY-TO' => 'admin@example.net'})
260
- message.reply_to = "dude@example.com.au"
259
+ message.headers({ 'REPLY-TO' => 'admin@example.net' })
260
+ message.reply_to = 'dude@example.com.au'
261
261
 
262
262
  body = Railgun.transform_for_mailgun(message)
263
263
  expect(body).to include('h:reply-to')
@@ -267,12 +267,12 @@ describe 'Railgun::Mailer' do
267
267
 
268
268
  it 'ignores `mime-version` in headers' do
269
269
  message = UnitTestMailer.plain_message('test@example.org', '', {
270
- 'mime-version' => '1.0',
271
- })
270
+ 'mime-version' => '1.0'
271
+ })
272
272
  message.mailgun_headers = {
273
- 'Mime-Version' => '1.1',
273
+ 'Mime-Version' => '1.1'
274
274
  }
275
- message.headers({'MIME-VERSION' => '1.2'})
275
+ message.headers({ 'MIME-VERSION' => '1.2' })
276
276
 
277
277
  body = Railgun.transform_for_mailgun(message)
278
278
  expect(body).not_to include('h:mime-version')
@@ -280,32 +280,32 @@ describe 'Railgun::Mailer' do
280
280
 
281
281
  it 'treats `headers()` names as case-insensitve' do
282
282
  message = UnitTestMailer.plain_message('test@example.org', '', {
283
- 'X-BIG-VALUE' => 1,
284
- })
283
+ 'X-BIG-VALUE' => 1
284
+ })
285
285
 
286
286
  body = Railgun.transform_for_mailgun(message)
287
287
  expect(body).to include('h:x-big-value')
288
- expect(body['h:x-big-value']).to eq("1")
288
+ expect(body['h:x-big-value']).to eq('1')
289
289
  end
290
290
 
291
291
  it 'treats `mailgun_headers` names as case-insensitive' do
292
292
  message = UnitTestMailer.plain_message('test@example.org', '', {})
293
293
  message.mailgun_headers = {
294
- 'X-BIG-VALUE' => 1,
294
+ 'X-BIG-VALUE' => 1
295
295
  }
296
296
 
297
297
  body = Railgun.transform_for_mailgun(message)
298
298
  expect(body).to include('h:x-big-value')
299
- expect(body['h:x-big-value']).to eq("1")
299
+ expect(body['h:x-big-value']).to eq('1')
300
300
  end
301
301
 
302
302
  it 'handles multi-value, mixed case headers correctly' do
303
303
  message = UnitTestMailer.plain_message('test@example.org', '', {})
304
304
  message.headers({
305
- 'x-neat-header' => 'foo',
306
- 'X-Neat-Header' => 'bar',
307
- 'X-NEAT-HEADER' => 'zoop',
308
- })
305
+ 'x-neat-header' => 'foo',
306
+ 'X-Neat-Header' => 'bar',
307
+ 'X-NEAT-HEADER' => 'zoop'
308
+ })
309
309
 
310
310
  body = Railgun.transform_for_mailgun(message)
311
311
  expect(body).to include('h:x-neat-header')
@@ -0,0 +1,187 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.mailgun.net/v1/analytics/tags
6
+ body:
7
+ encoding: UTF-8
8
+ string: include_subaccounts=true&pagination=%7Bsort%3A+%22lastseen%3Adesc%22%2C+limit%3A+10%7D
9
+ headers:
10
+ User-Agent:
11
+ - mailgun-sdk-ruby/1.4.1
12
+ Accept:
13
+ - "*/*"
14
+ Authorization:
15
+ - Basic xxx
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
+ 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-Length:
32
+ - '317'
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ Date:
36
+ - Wed, 28 Jan 2026 18:49:42 GMT
37
+ Strict-Transport-Security:
38
+ - max-age=63072000; includeSubDomains
39
+ X-Mailgun-Key-Id:
40
+ - xxx
41
+ X-Xss-Protection:
42
+ - 1; mode=block
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"items":[{"account_id":"test","parent_account_id":"test","tag":"test1","description":"","first_seen":"Wed,
46
+ 28 Jan 2026 18:27:11 +0000","last_seen":"Wed, 28 Jan 2026 18:00:00 +0000","metrics":{},"account_name":"Alex
47
+ Lebedev"}],"pagination":{"sort":"lastseen:desc","limit":10}}
48
+
49
+ '
50
+ recorded_at: Wed, 28 Jan 2026 18:49:42 GMT
51
+ - request:
52
+ method: get
53
+ uri: https://api.mailgun.net/v1/analytics/tags/limits
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - mailgun-sdk-ruby/1.4.1
60
+ Accept:
61
+ - "*/*"
62
+ Authorization:
63
+ - Basic xxx
64
+ Accept-Encoding:
65
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
66
+ response:
67
+ status:
68
+ code: 200
69
+ message: OK
70
+ headers:
71
+ Access-Control-Allow-Credentials:
72
+ - 'true'
73
+ Access-Control-Allow-Origin:
74
+ - "*"
75
+ Cache-Control:
76
+ - no-store
77
+ Content-Length:
78
+ - '49'
79
+ Content-Type:
80
+ - application/json; charset=utf-8
81
+ Date:
82
+ - Wed, 28 Jan 2026 18:55:47 GMT
83
+ Strict-Transport-Security:
84
+ - max-age=63072000; includeSubDomains
85
+ X-Mailgun-Key-Id:
86
+ - xxx
87
+ X-Xss-Protection:
88
+ - 1; mode=block
89
+ body:
90
+ encoding: UTF-8
91
+ string: '{"limit":100000,"count":1,"limit_reached":false}
92
+
93
+ '
94
+ recorded_at: Wed, 28 Jan 2026 18:55:47 GMT
95
+ - request:
96
+ method: put
97
+ uri: https://api.mailgun.net/v1/analytics/tags
98
+ body:
99
+ encoding: UTF-8
100
+ string: '{"tag":"test1","description":"test_description"}'
101
+ headers:
102
+ User-Agent:
103
+ - mailgun-sdk-ruby/1.4.2
104
+ Accept:
105
+ - "*/*"
106
+ Content-Type:
107
+ - application/json
108
+ Authorization:
109
+ - Basic xxx
110
+ Accept-Encoding:
111
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
112
+ response:
113
+ status:
114
+ code: 200
115
+ message: OK
116
+ headers:
117
+ Access-Control-Allow-Credentials:
118
+ - 'true'
119
+ Access-Control-Allow-Origin:
120
+ - "*"
121
+ Cache-Control:
122
+ - no-store
123
+ Content-Length:
124
+ - '26'
125
+ Content-Type:
126
+ - application/json; charset=utf-8
127
+ Date:
128
+ - Wed, 28 Jan 2026 20:04:23 GMT
129
+ Strict-Transport-Security:
130
+ - max-age=63072000; includeSubDomains
131
+ X-Mailgun-Key-Id:
132
+ - xxx
133
+ X-Xss-Protection:
134
+ - 1; mode=block
135
+ body:
136
+ encoding: UTF-8
137
+ string: '{"message":"Tag updated"}
138
+
139
+ '
140
+ recorded_at: Wed, 28 Jan 2026 20:04:23 GMT
141
+ - request:
142
+ method: delete
143
+ uri: https://api.mailgun.net/v1/analytics/tags
144
+ body:
145
+ encoding: UTF-8
146
+ string: '{"tag":"test1"}'
147
+ headers:
148
+ User-Agent:
149
+ - mailgun-sdk-ruby/1.4.2
150
+ Accept:
151
+ - "*/*"
152
+ Authorization:
153
+ - Basic xxx
154
+ Content-Type:
155
+ - application/x-www-form-urlencoded
156
+ Accept-Encoding:
157
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
158
+ response:
159
+ status:
160
+ code: 200
161
+ message: OK
162
+ headers:
163
+ Access-Control-Allow-Credentials:
164
+ - 'true'
165
+ Access-Control-Allow-Origin:
166
+ - "*"
167
+ Cache-Control:
168
+ - no-store
169
+ Content-Length:
170
+ - '26'
171
+ Content-Type:
172
+ - application/json; charset=utf-8
173
+ Date:
174
+ - Wed, 28 Jan 2026 20:05:54 GMT
175
+ Strict-Transport-Security:
176
+ - max-age=63072000; includeSubDomains
177
+ X-Mailgun-Key-Id:
178
+ - xxx
179
+ X-Xss-Protection:
180
+ - 1; mode=block
181
+ body:
182
+ encoding: UTF-8
183
+ string: '{"message":"Tag deleted"}
184
+
185
+ '
186
+ recorded_at: Wed, 28 Jan 2026 20:05:54 GMT
187
+ recorded_with: VCR 6.4.0
@@ -1088,4 +1088,156 @@ http_interactions:
1088
1088
  '
1089
1089
  http_version:
1090
1090
  recorded_at: Thu, 28 Aug 2025 14:47:08 GMT
1091
+ - request:
1092
+ method: put
1093
+ uri: https://api.mailgun.net/v4/domains/integration-test.domain.invalid/verify
1094
+ body:
1095
+ encoding: UTF-8
1096
+ string: ''
1097
+ headers:
1098
+ User-Agent:
1099
+ - mailgun-sdk-ruby/1.4.0
1100
+ Accept:
1101
+ - "*/*"
1102
+ Authorization:
1103
+ - Basic xxx
1104
+ Content-Length:
1105
+ - '0'
1106
+ Accept-Encoding:
1107
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1108
+ response:
1109
+ status:
1110
+ code: 200
1111
+ message: OK
1112
+ headers:
1113
+ Access-Control-Allow-Credentials:
1114
+ - 'true'
1115
+ Access-Control-Allow-Origin:
1116
+ - "*"
1117
+ Cache-Control:
1118
+ - no-store
1119
+ Content-Length:
1120
+ - '1752'
1121
+ Content-Type:
1122
+ - application/json; charset=utf-8
1123
+ Date:
1124
+ - Sat, 27 Dec 2025 23:47:46 GMT
1125
+ Strict-Transport-Security:
1126
+ - max-age=63072000; includeSubDomains
1127
+ X-Mailgun-Key-Id:
1128
+ - xxx
1129
+ X-Request-Limit:
1130
+ - '10'
1131
+ X-Request-Remaining:
1132
+ - '9'
1133
+ X-Request-Reset:
1134
+ - '1766879267069'
1135
+ X-Xss-Protection:
1136
+ - 1; mode=block
1137
+ body:
1138
+ encoding: UTF-8
1139
+ string: '{"message":"Domain DNS records have been updated","domain":{"created_at":"Thu,
1140
+ 27 Nov 2025 22:42:06 GMT","id":"xxx","is_disabled":false,"name":"integration-test.domain.invalid","require_tls":false,"skip_verification":false,"smtp_login":"","spam_action":"tag","state":"unverified","type":"custom","use_automatic_sender_security":false,"web_prefix":"email","web_scheme":"http","wildcard":false,"encrypt_incoming_message":false,"message_ttl":0},"sending_dns_records":[{"is_active":false,"cached":[],"name":"k1._domainkey.integration-test.domain.invalid","record_type":"TXT","valid":"unknown","value":"k=rsa;
1141
+ p=xxx+xxx+xxx"},{"is_active":false,"cached":[],"name":"string._domainkey.integration-test.domain.invalid","record_type":"TXT","valid":"unknown","value":"k=rsa;
1142
+ p=xxx/xxx+xx+xxx+xxx+xxx/xxx/xxx"},{"is_active":true,"cached":[],"name":"integration-test.domain.invalid","record_type":"TXT","valid":"unknown","value":"v=spf1
1143
+ include:mailgun.org ~all"},{"is_active":true,"cached":[],"name":"email.integration-test.domain.invalid","record_type":"CNAME","valid":"unknown","value":"mailgun.org"}],"receiving_dns_records":[{"is_active":true,"cached":[],"priority":"10","record_type":"MX","valid":"unknown","value":"mxa.mailgun.org"},{"is_active":true,"cached":[],"priority":"10","record_type":"MX","valid":"unknown","value":"mxb.mailgun.org"}]}
1144
+
1145
+ '
1146
+ http_version:
1147
+ recorded_at: Sat, 27 Dec 2025 23:47:46 GMT
1148
+ - request:
1149
+ method: post
1150
+ uri: https://api.mailgun.net/v1/dkim/keys
1151
+ body:
1152
+ encoding: UTF-8
1153
+ string: selector=test&signing_domain=integration-test.domain.invalid
1154
+ headers:
1155
+ User-Agent:
1156
+ - mailgun-sdk-ruby/1.4.0
1157
+ Accept:
1158
+ - "*/*"
1159
+ Authorization:
1160
+ - Basic xxx
1161
+ Content-Type:
1162
+ - application/x-www-form-urlencoded
1163
+ Accept-Encoding:
1164
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1165
+ response:
1166
+ status:
1167
+ code: 200
1168
+ message: OK
1169
+ headers:
1170
+ Access-Control-Allow-Credentials:
1171
+ - 'true'
1172
+ Access-Control-Allow-Origin:
1173
+ - "*"
1174
+ Cache-Control:
1175
+ - no-store
1176
+ Content-Length:
1177
+ - '447'
1178
+ Content-Type:
1179
+ - application/json; charset=utf-8
1180
+ Date:
1181
+ - Sun, 28 Dec 2025 00:07:03 GMT
1182
+ Strict-Transport-Security:
1183
+ - max-age=63072000; includeSubDomains
1184
+ X-Mailgun-Key-Id:
1185
+ - xxx
1186
+ X-Xss-Protection:
1187
+ - 1; mode=block
1188
+ body:
1189
+ encoding: UTF-8
1190
+ string: '{"signing_domain":"integration-test.domain.invalid","selector":"test","dns_record":{"is_active":false,"cached":[],"name":"test._domainkey.integration-test.domain.invalid","record_type":"TXT","valid":"unknown","value":"k=rsa;
1191
+ p=xxx"}}
1192
+
1193
+ '
1194
+ http_version:
1195
+ recorded_at: Sun, 28 Dec 2025 00:07:03 GMT
1196
+ - request:
1197
+ method: get
1198
+ uri: https://api.mailgun.net/v1/dkim/keys?signing_domain=integration-test.domain.invalid
1199
+ body:
1200
+ encoding: US-ASCII
1201
+ string: ''
1202
+ headers:
1203
+ User-Agent:
1204
+ - mailgun-sdk-ruby/1.4.0
1205
+ Accept:
1206
+ - "*/*"
1207
+ Authorization:
1208
+ - Basic xxx
1209
+ Accept-Encoding:
1210
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1211
+ response:
1212
+ status:
1213
+ code: 200
1214
+ message: OK
1215
+ headers:
1216
+ Access-Control-Allow-Credentials:
1217
+ - 'true'
1218
+ Access-Control-Allow-Origin:
1219
+ - "*"
1220
+ Cache-Control:
1221
+ - no-store
1222
+ Content-Length:
1223
+ - '1767'
1224
+ Content-Type:
1225
+ - application/json; charset=utf-8
1226
+ Date:
1227
+ - Sun, 28 Dec 2025 00:12:23 GMT
1228
+ Strict-Transport-Security:
1229
+ - max-age=63072000; includeSubDomains
1230
+ X-Mailgun-Key-Id:
1231
+ - xxx
1232
+ X-Xss-Protection:
1233
+ - 1; mode=block
1234
+ body:
1235
+ encoding: UTF-8
1236
+ string: '{"items":[{"signing_domain":"integration-test.domain.invalid","selector":"k1","dns_record":{"is_active":false,"cached":[],"name":"k1._domainkey.integration-test.domain.invalid","record_type":"TXT","valid":"unknown","value":"k=rsa;
1237
+ p=xxx"}},{"signing_domain":"integration-test.domain.invalid","selector":"test","dns_record":{"is_active":false,"cached":[],"name":"test._domainkey.integration-test.domain.invalid","record_type":"TXT","valid":"unknown","value":"k=rsa;
1238
+ p=xxx"}}],"paging":{"previous":"https://api.mailgun.net/v1/dkim/keys?page=xxx","first":"https://api.mailgun.net/v1/dkim/keys?page=xxx","next":"https://api.mailgun.net/v1/dkim/keys?page=xxx","last":"https://api.mailgun.net/v1/dkim/keys?page=xxx"}}
1239
+
1240
+ '
1241
+ http_version:
1242
+ recorded_at: Sun, 28 Dec 2025 00:12:23 GMT
1091
1243
  recorded_with: VCR 3.0.3