mailgun-ruby 1.4.1 → 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.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/README.md +1 -1
- data/Rakefile +5 -3
- data/docs/AnalyticsTags.md +63 -0
- data/lib/mailgun/address.rb +5 -5
- data/lib/mailgun/chains.rb +2 -3
- data/lib/mailgun/client.rb +47 -51
- data/lib/mailgun/domains/domains.rb +7 -8
- data/lib/mailgun/events/events.rb +4 -3
- data/lib/mailgun/exceptions/exceptions.rb +12 -15
- data/lib/mailgun/helpers/api_version_checker.rb +6 -1
- data/lib/mailgun/lists/opt_in_handler.rb +4 -6
- data/lib/mailgun/logs/logs.rb +4 -2
- data/lib/mailgun/messages/batch_message.rb +8 -9
- data/lib/mailgun/messages/message_builder.rb +36 -24
- data/lib/mailgun/metrics/metrics.rb +6 -4
- data/lib/mailgun/response.rb +11 -9
- data/lib/mailgun/subaccounts/subaccounts.rb +13 -8
- data/lib/mailgun/suppressions.rb +36 -43
- data/lib/mailgun/tags/analytics_tags.rb +33 -2
- data/lib/mailgun/tags/tags.rb +25 -17
- data/lib/mailgun/templates/templates.rb +40 -29
- data/lib/mailgun/version.rb +3 -1
- data/lib/mailgun/webhooks/webhooks.rb +22 -19
- data/lib/mailgun-ruby.rb +2 -0
- data/lib/mailgun.rb +4 -4
- data/lib/railgun/attachment.rb +9 -14
- data/lib/railgun/errors.rb +2 -3
- data/lib/railgun/mailer.rb +35 -39
- data/lib/railgun/railtie.rb +2 -0
- data/lib/railgun.rb +2 -0
- data/mailgun.gemspec +12 -11
- data/spec/integration/analytics_tags_spec.rb +54 -0
- data/spec/integration/bounces_spec.rb +12 -11
- data/spec/integration/campaign_spec.rb +20 -18
- data/spec/integration/complaints_spec.rb +8 -6
- data/spec/integration/domains_spec.rb +6 -6
- data/spec/integration/email_validation_spec.rb +35 -34
- data/spec/integration/events_spec.rb +7 -5
- data/spec/integration/list_members_spec.rb +27 -26
- data/spec/integration/list_spec.rb +22 -21
- data/spec/integration/logs_spec.rb +48 -46
- data/spec/integration/mailer_spec.rb +7 -3
- data/spec/integration/mailgun_spec.rb +82 -90
- data/spec/integration/metrics_spec.rb +130 -130
- data/spec/integration/routes_spec.rb +41 -40
- data/spec/integration/stats_spec.rb +4 -2
- data/spec/integration/subaccounts_spec.rb +9 -10
- data/spec/integration/suppressions_spec.rb +21 -20
- data/spec/integration/templates_spec.rb +14 -12
- data/spec/integration/unsubscribes_spec.rb +8 -6
- data/spec/integration/webhook_spec.rb +13 -12
- data/spec/spec_helper.rb +8 -8
- data/spec/unit/connection/test_client.rb +61 -55
- data/spec/unit/events/events_spec.rb +25 -22
- data/spec/unit/exceptions/exceptions_spec.rb +8 -7
- data/spec/unit/lists/opt_in_handler_spec.rb +8 -6
- data/spec/unit/mailgun_spec.rb +64 -63
- data/spec/unit/messages/batch_message_spec.rb +15 -15
- data/spec/unit/messages/message_builder_spec.rb +98 -94
- data/spec/unit/railgun/content_type_spec.rb +24 -23
- data/spec/unit/railgun/mailer_spec.rb +58 -58
- data/vcr_cassettes/analytics_tags.yml +187 -0
- metadata +49 -33
- data/.rubocop.yml +0 -8
- data/.rubocop_todo.yml +0 -22
|
@@ -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:
|
|
19
|
-
format.html { render html:
|
|
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
|
-
:
|
|
26
|
-
:
|
|
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:
|
|
30
|
-
format.html { render html:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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' => {:
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
[
|
|
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[
|
|
206
|
-
expect(body[
|
|
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[
|
|
218
|
-
expect(body[
|
|
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[
|
|
230
|
-
expect(body[
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
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.4.
|
|
4
|
+
version: 1.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mailgun
|
|
@@ -25,33 +25,33 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 1.16.2
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: pry
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 0.16.0
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 0.16.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: rails
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rake
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -67,47 +67,47 @@ dependencies:
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 13.3.1
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: rspec
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
75
|
+
version: 3.13.0
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
82
|
+
version: 3.13.0
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
84
|
+
name: rspec-its
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
87
|
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0.
|
|
89
|
+
version: 2.0.0
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0.
|
|
96
|
+
version: 2.0.0
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
98
|
+
name: rubocop
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- - "
|
|
101
|
+
- - ">="
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
103
|
+
version: '0'
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- - "
|
|
108
|
+
- - ">="
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
110
|
+
version: '0'
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: simplecov
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -123,33 +123,33 @@ dependencies:
|
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: 0.16.1
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
126
|
+
name: vcr
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
|
-
- - "
|
|
129
|
+
- - "~>"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version:
|
|
131
|
+
version: 6.4.0
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
|
-
- - "
|
|
136
|
+
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version:
|
|
138
|
+
version: 6.4.0
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
140
|
+
name: webmock
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
|
143
|
-
- - "
|
|
143
|
+
- - "~>"
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '
|
|
146
|
-
type: :
|
|
145
|
+
version: '3.7'
|
|
146
|
+
type: :development
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
|
-
- - "
|
|
150
|
+
- - "~>"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '
|
|
152
|
+
version: '3.7'
|
|
153
153
|
- !ruby/object:Gem::Dependency
|
|
154
154
|
name: faraday
|
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -178,6 +178,20 @@ dependencies:
|
|
|
178
178
|
- - "<"
|
|
179
179
|
- !ruby/object:Gem::Version
|
|
180
180
|
version: '2'
|
|
181
|
+
- !ruby/object:Gem::Dependency
|
|
182
|
+
name: mini_mime
|
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
|
184
|
+
requirements:
|
|
185
|
+
- - ">="
|
|
186
|
+
- !ruby/object:Gem::Version
|
|
187
|
+
version: '0'
|
|
188
|
+
type: :runtime
|
|
189
|
+
prerelease: false
|
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
191
|
+
requirements:
|
|
192
|
+
- - ">="
|
|
193
|
+
- !ruby/object:Gem::Version
|
|
194
|
+
version: '0'
|
|
181
195
|
- !ruby/object:Gem::Dependency
|
|
182
196
|
name: zeitwerk
|
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -200,14 +214,13 @@ extra_rdoc_files: []
|
|
|
200
214
|
files:
|
|
201
215
|
- ".github/workflows/ci.yml"
|
|
202
216
|
- ".gitignore"
|
|
203
|
-
- ".rubocop.yml"
|
|
204
|
-
- ".rubocop_todo.yml"
|
|
205
217
|
- ".ruby-env.yml.example"
|
|
206
218
|
- CHANGELOG.md
|
|
207
219
|
- Gemfile
|
|
208
220
|
- LICENSE
|
|
209
221
|
- README.md
|
|
210
222
|
- Rakefile
|
|
223
|
+
- docs/AnalyticsTags.md
|
|
211
224
|
- docs/Domains.md
|
|
212
225
|
- docs/EmailValidation.md
|
|
213
226
|
- docs/Events.md
|
|
@@ -251,6 +264,7 @@ files:
|
|
|
251
264
|
- lib/railgun/mailer.rb
|
|
252
265
|
- lib/railgun/railtie.rb
|
|
253
266
|
- mailgun.gemspec
|
|
267
|
+
- spec/integration/analytics_tags_spec.rb
|
|
254
268
|
- spec/integration/bounces_spec.rb
|
|
255
269
|
- spec/integration/campaign_spec.rb
|
|
256
270
|
- spec/integration/complaints_spec.rb
|
|
@@ -285,6 +299,7 @@ files:
|
|
|
285
299
|
- spec/unit/messages/sample_data/unknown.type
|
|
286
300
|
- spec/unit/railgun/content_type_spec.rb
|
|
287
301
|
- spec/unit/railgun/mailer_spec.rb
|
|
302
|
+
- vcr_cassettes/analytics_tags.yml
|
|
288
303
|
- vcr_cassettes/bounces.yml
|
|
289
304
|
- vcr_cassettes/complaints.yml
|
|
290
305
|
- vcr_cassettes/domains.todo.yml
|
|
@@ -334,6 +349,7 @@ rubygems_version: 4.0.3
|
|
|
334
349
|
specification_version: 4
|
|
335
350
|
summary: Mailgun's Official Ruby SDK
|
|
336
351
|
test_files:
|
|
352
|
+
- spec/integration/analytics_tags_spec.rb
|
|
337
353
|
- spec/integration/bounces_spec.rb
|
|
338
354
|
- spec/integration/campaign_spec.rb
|
|
339
355
|
- spec/integration/complaints_spec.rb
|