mailgun-ruby 1.3.10 → 1.4.1
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/.github/workflows/ci.yml +2 -3
- data/CHANGELOG.md +11 -2
- data/README.md +1 -1
- data/docs/Domains.md +71 -18
- data/docs/MessageBuilder.md +1 -1
- data/lib/mailgun/address.rb +0 -2
- data/lib/mailgun/client.rb +36 -21
- data/lib/mailgun/domains/domains.rb +187 -176
- data/lib/mailgun/events/events.rb +0 -2
- data/lib/mailgun/exceptions/exceptions.rb +2 -0
- data/lib/mailgun/helpers/api_version_checker.rb +41 -0
- data/lib/mailgun/lists/opt_in_handler.rb +0 -3
- data/lib/mailgun/logs/logs.rb +0 -2
- data/lib/mailgun/messages/batch_message.rb +0 -2
- data/lib/mailgun/messages/message_builder.rb +0 -4
- data/lib/mailgun/metrics/metrics.rb +0 -2
- data/lib/mailgun/subaccounts/subaccounts.rb +0 -2
- data/lib/mailgun/suppressions.rb +2 -6
- data/lib/mailgun/tags/analytics_tags.rb +32 -0
- data/lib/mailgun/tags/tags.rb +11 -2
- data/lib/mailgun/templates/templates.rb +0 -2
- data/lib/mailgun/version.rb +1 -1
- data/lib/mailgun-ruby.rb +2 -2
- data/lib/mailgun.rb +34 -18
- data/lib/railgun/mailer.rb +0 -6
- data/lib/railgun/railtie.rb +9 -2
- data/lib/railgun.rb +12 -5
- data/mailgun.gemspec +7 -7
- data/spec/integration/domains_spec.rb +218 -192
- data/spec/spec_helper.rb +1 -5
- data/vcr_cassettes/domains.yml +152 -0
- metadata +32 -20
- data/lib/railgun/message.rb +0 -18
- data/spec/integration/tags.rb +0 -139
- data/vcr_cassettes/tags.yml +0 -417
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailgun-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mailgun
|
|
8
8
|
- Travis Swientek
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -44,28 +44,28 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: 2.0.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: 2.0.0
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rake
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 13.3.1
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
68
|
+
version: 13.3.1
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: webmock
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,28 +86,28 @@ dependencies:
|
|
|
86
86
|
requirements:
|
|
87
87
|
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0.
|
|
89
|
+
version: 0.16.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: 0.16.0
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: vcr
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
101
|
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
103
|
+
version: 6.4.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: 6.4.0
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: simplecov
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -168,16 +168,30 @@ dependencies:
|
|
|
168
168
|
name: faraday-multipart
|
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
|
170
170
|
requirements:
|
|
171
|
-
- - "
|
|
171
|
+
- - "<"
|
|
172
172
|
- !ruby/object:Gem::Version
|
|
173
|
-
version:
|
|
173
|
+
version: '2'
|
|
174
174
|
type: :runtime
|
|
175
175
|
prerelease: false
|
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
177
|
requirements:
|
|
178
|
-
- - "
|
|
178
|
+
- - "<"
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '2'
|
|
181
|
+
- !ruby/object:Gem::Dependency
|
|
182
|
+
name: zeitwerk
|
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
|
184
|
+
requirements:
|
|
185
|
+
- - ">="
|
|
179
186
|
- !ruby/object:Gem::Version
|
|
180
|
-
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
|
description: Mailgun's Official Ruby SDK for interacting with the Mailgun API.
|
|
182
196
|
email: support@mailgunhq.com
|
|
183
197
|
executables: []
|
|
@@ -217,6 +231,7 @@ files:
|
|
|
217
231
|
- lib/mailgun/domains/domains.rb
|
|
218
232
|
- lib/mailgun/events/events.rb
|
|
219
233
|
- lib/mailgun/exceptions/exceptions.rb
|
|
234
|
+
- lib/mailgun/helpers/api_version_checker.rb
|
|
220
235
|
- lib/mailgun/lists/opt_in_handler.rb
|
|
221
236
|
- lib/mailgun/logs/logs.rb
|
|
222
237
|
- lib/mailgun/messages/batch_message.rb
|
|
@@ -225,6 +240,7 @@ files:
|
|
|
225
240
|
- lib/mailgun/response.rb
|
|
226
241
|
- lib/mailgun/subaccounts/subaccounts.rb
|
|
227
242
|
- lib/mailgun/suppressions.rb
|
|
243
|
+
- lib/mailgun/tags/analytics_tags.rb
|
|
228
244
|
- lib/mailgun/tags/tags.rb
|
|
229
245
|
- lib/mailgun/templates/templates.rb
|
|
230
246
|
- lib/mailgun/version.rb
|
|
@@ -233,7 +249,6 @@ files:
|
|
|
233
249
|
- lib/railgun/attachment.rb
|
|
234
250
|
- lib/railgun/errors.rb
|
|
235
251
|
- lib/railgun/mailer.rb
|
|
236
|
-
- lib/railgun/message.rb
|
|
237
252
|
- lib/railgun/railtie.rb
|
|
238
253
|
- mailgun.gemspec
|
|
239
254
|
- spec/integration/bounces_spec.rb
|
|
@@ -253,7 +268,6 @@ files:
|
|
|
253
268
|
- spec/integration/stats_spec.rb
|
|
254
269
|
- spec/integration/subaccounts_spec.rb
|
|
255
270
|
- spec/integration/suppressions_spec.rb
|
|
256
|
-
- spec/integration/tags.rb
|
|
257
271
|
- spec/integration/templates_spec.rb
|
|
258
272
|
- spec/integration/unsubscribes_spec.rb
|
|
259
273
|
- spec/integration/webhook_spec.rb
|
|
@@ -293,7 +307,6 @@ files:
|
|
|
293
307
|
- vcr_cassettes/stats.yml
|
|
294
308
|
- vcr_cassettes/subaccounts.yml
|
|
295
309
|
- vcr_cassettes/suppressions.yml
|
|
296
|
-
- vcr_cassettes/tags.yml
|
|
297
310
|
- vcr_cassettes/templates.yml
|
|
298
311
|
- vcr_cassettes/unsubscribes.yml
|
|
299
312
|
- vcr_cassettes/webhooks.yml
|
|
@@ -310,14 +323,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
310
323
|
requirements:
|
|
311
324
|
- - ">="
|
|
312
325
|
- !ruby/object:Gem::Version
|
|
313
|
-
version:
|
|
326
|
+
version: 3.0.0
|
|
314
327
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
328
|
requirements:
|
|
316
329
|
- - ">="
|
|
317
330
|
- !ruby/object:Gem::Version
|
|
318
331
|
version: '0'
|
|
319
332
|
requirements: []
|
|
320
|
-
rubygems_version:
|
|
333
|
+
rubygems_version: 4.0.3
|
|
321
334
|
specification_version: 4
|
|
322
335
|
summary: Mailgun's Official Ruby SDK
|
|
323
336
|
test_files:
|
|
@@ -338,7 +351,6 @@ test_files:
|
|
|
338
351
|
- spec/integration/stats_spec.rb
|
|
339
352
|
- spec/integration/subaccounts_spec.rb
|
|
340
353
|
- spec/integration/suppressions_spec.rb
|
|
341
|
-
- spec/integration/tags.rb
|
|
342
354
|
- spec/integration/templates_spec.rb
|
|
343
355
|
- spec/integration/unsubscribes_spec.rb
|
|
344
356
|
- spec/integration/webhook_spec.rb
|
data/lib/railgun/message.rb
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
require 'mail'
|
|
2
|
-
require 'mailgun/messages/message_builder'
|
|
3
|
-
require 'railgun/attachment'
|
|
4
|
-
require 'railgun/errors'
|
|
5
|
-
|
|
6
|
-
module Mail
|
|
7
|
-
|
|
8
|
-
class Message
|
|
9
|
-
|
|
10
|
-
# Attributes to hold Mailgun-specific information
|
|
11
|
-
attr_accessor :mailgun_variables,
|
|
12
|
-
:mailgun_options,
|
|
13
|
-
:mailgun_recipient_variables,
|
|
14
|
-
:mailgun_headers,
|
|
15
|
-
:mailgun_template_variables
|
|
16
|
-
|
|
17
|
-
end
|
|
18
|
-
end
|
data/spec/integration/tags.rb
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'mailgun'
|
|
3
|
-
|
|
4
|
-
vcr_opts = { :cassette_name => "tags" }
|
|
5
|
-
|
|
6
|
-
describe 'For the tags endpoints', vcr: vcr_opts do
|
|
7
|
-
let(:tag_name) { 'abtest-option-a' }
|
|
8
|
-
let(:domain) { "integration-test.domain.invalid" }
|
|
9
|
-
|
|
10
|
-
before(:all) do
|
|
11
|
-
@mg_client = Mailgun::Client.new(APIKEY, APIHOST, APIVERSION, SSL)
|
|
12
|
-
@tags = Mailgun::Tags.new(@mg_client)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe '#get_tags' do
|
|
16
|
-
it 'returs tags info' do
|
|
17
|
-
result = @tags.get_tags(domain)
|
|
18
|
-
|
|
19
|
-
expect(result.first['tag']).to eq('You can track mails as tag-units!')
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
describe '#get_tag' do
|
|
24
|
-
it "return the tag's info" do
|
|
25
|
-
result = @tags.get_tag(domain, tag_name)
|
|
26
|
-
|
|
27
|
-
expect(result['tag']).to eq(tag_name)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
describe '#update' do
|
|
32
|
-
it "returns true" do
|
|
33
|
-
result = @tags.update(
|
|
34
|
-
domain,
|
|
35
|
-
tag_name,
|
|
36
|
-
{ description: 'new description 2' }
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
expect(result).to eq(true)
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
describe '#get_tag_stats' do
|
|
44
|
-
it "returns tag stats info" do
|
|
45
|
-
result = @tags.get_tag_stats(
|
|
46
|
-
domain,
|
|
47
|
-
tag_name,
|
|
48
|
-
{
|
|
49
|
-
event: 'accepted',
|
|
50
|
-
start: 'Tue, 23 Jan 2024 11:23:45 EST',
|
|
51
|
-
resolution: 'day'
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
expect(result).to include('stats')
|
|
56
|
-
expect(result['stats'].first['accepted']).to include(
|
|
57
|
-
{
|
|
58
|
-
'incoming' => 0,
|
|
59
|
-
'outgoing' => 0,
|
|
60
|
-
'total' => 0
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
describe '#get_countries_aggregated_stats' do
|
|
67
|
-
it "returns countries of origin for a given domain" do
|
|
68
|
-
result = @tags.get_countries_aggregated_stats(
|
|
69
|
-
domain,
|
|
70
|
-
tag_name
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
expect(result).to include('country')
|
|
74
|
-
expect(result['country']['ad']).to include(
|
|
75
|
-
{
|
|
76
|
-
'clicked' => 0,
|
|
77
|
-
'complained' => 0,
|
|
78
|
-
'opened' => 0,
|
|
79
|
-
'unique_clicked' => 0,
|
|
80
|
-
'unique_opened' => 0,
|
|
81
|
-
'unsubscribed' => 0
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
describe '#get_providers_aggregated_stats' do
|
|
88
|
-
it "returns email providers for a given domain" do
|
|
89
|
-
result = @tags.get_providers_aggregated_stats(
|
|
90
|
-
domain,
|
|
91
|
-
tag_name
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
expect(result).to include('provider')
|
|
95
|
-
expect(result['provider']['aol.com']).to include(
|
|
96
|
-
{
|
|
97
|
-
'clicked' => 0,
|
|
98
|
-
'complained' => 0,
|
|
99
|
-
'opened' => 0,
|
|
100
|
-
'unique_clicked' => 0,
|
|
101
|
-
'unique_opened' => 0,
|
|
102
|
-
'unsubscribed' => 0
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
describe '#get_devices_aggregated_stats' do
|
|
109
|
-
it "returns devices for a given domain" do
|
|
110
|
-
result = @tags.get_devices_aggregated_stats(
|
|
111
|
-
domain,
|
|
112
|
-
tag_name
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
expect(result).to include('device')
|
|
116
|
-
expect(result['device']['desktop']).to include(
|
|
117
|
-
{
|
|
118
|
-
'clicked' => 0,
|
|
119
|
-
'complained' => 0,
|
|
120
|
-
'opened' => 28,
|
|
121
|
-
'unique_clicked' => 0,
|
|
122
|
-
'unique_opened' => 24,
|
|
123
|
-
'unsubscribed' => 0
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
describe '#remove' do
|
|
130
|
-
it "returns true" do
|
|
131
|
-
result = @tags.remove(
|
|
132
|
-
domain,
|
|
133
|
-
tag_name
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
expect(result).to eq(true)
|
|
137
|
-
end
|
|
138
|
-
end
|
|
139
|
-
end
|