mailgun-ruby 1.4.1 → 1.4.3
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 +30 -8
- data/.rubocop.yml +64 -4
- data/Gemfile +3 -1
- data/README.md +1 -1
- data/Rakefile +5 -8
- 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 +56 -56
- data/lib/mailgun/domains/domains.rb +11 -10
- 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 +6 -10
- data/lib/mailgun/logs/logs.rb +4 -2
- data/lib/mailgun/messages/batch_message.rb +10 -10
- data/lib/mailgun/messages/message_builder.rb +40 -56
- data/lib/mailgun/metrics/metrics.rb +12 -6
- data/lib/mailgun/response.rb +12 -10
- data/lib/mailgun/subaccounts/subaccounts.rb +13 -8
- data/lib/mailgun/suppressions.rb +36 -43
- data/lib/mailgun/tags/analytics_tags.rb +37 -2
- data/lib/mailgun/tags/tags.rb +29 -19
- 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 +12 -19
- data/lib/railgun/errors.rb +2 -3
- data/lib/railgun/mailer.rb +37 -41
- data/lib/railgun/railtie.rb +2 -0
- data/lib/railgun.rb +2 -0
- data/mailgun.gemspec +15 -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 +12 -18
- data/spec/integration/email_validation_spec.rb +35 -34
- data/spec/integration/events_spec.rb +8 -8
- data/spec/integration/list_members_spec.rb +27 -26
- data/spec/integration/list_spec.rb +22 -21
- data/spec/integration/logs_spec.rb +49 -47
- data/spec/integration/mailer_spec.rb +7 -3
- data/spec/integration/mailgun_spec.rb +85 -92
- data/spec/integration/metrics_spec.rb +137 -131
- 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 +222 -44
- data/spec/integration/templates_spec.rb +14 -12
- data/spec/integration/unsubscribes_spec.rb +8 -6
- data/spec/integration/webhook_spec.rb +18 -12
- data/spec/spec_helper.rb +15 -8
- data/spec/unit/client_spec.rb +424 -0
- data/spec/unit/connection/test_client.rb +108 -55
- data/spec/unit/events/events_spec.rb +48 -29
- data/spec/unit/exceptions/exceptions_spec.rb +8 -7
- data/spec/unit/helpers/api_version_checker_spec.rb +206 -0
- data/spec/unit/lists/opt_in_handler_spec.rb +11 -7
- data/spec/unit/mailgun_spec.rb +71 -68
- data/spec/unit/messages/batch_message_spec.rb +37 -36
- data/spec/unit/messages/message_builder_spec.rb +170 -169
- data/spec/unit/railgun/content_type_spec.rb +31 -30
- data/spec/unit/railgun/mailer_spec.rb +62 -59
- data/spec/unit/response_spec.rb +225 -0
- data/vcr_cassettes/For_the_suppressions_handling_class/creates_a_single_bounce.yml +55 -0
- data/vcr_cassettes/analytics_tags.yml +187 -0
- data/vcr_cassettes/suppressions.yml +1053 -170
- metadata +95 -29
- data/.rubocop_todo.yml +0 -22
|
@@ -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
|