mailgun-ruby 1.1.8 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -5
- data/Gemfile +1 -1
- data/README.md +24 -2
- data/docs/Domains.md +0 -0
- data/docs/Webhooks.md +1 -1
- data/docs/railgun/Overview.md +11 -0
- data/docs/railgun/Parameters.md +83 -0
- data/lib/mailgun/client.rb +27 -6
- data/lib/mailgun/events/events.rb +1 -1
- data/lib/mailgun/exceptions/exceptions.rb +2 -0
- data/lib/mailgun/messages/batch_message.rb +1 -0
- data/lib/mailgun/messages/message_builder.rb +61 -6
- data/lib/mailgun/suppressions.rb +4 -1
- data/lib/mailgun/version.rb +1 -1
- data/lib/mailgun/webhooks/webhooks.rb +1 -1
- data/lib/railgun/mailer.rb +105 -13
- data/lib/railgun/message.rb +2 -1
- data/lib/railgun/railtie.rb +3 -2
- data/mailgun.gemspec +11 -11
- data/spec/integration/email_validation_spec.rb +8 -0
- data/spec/integration/events_spec.rb +1 -1
- data/spec/integration/mailer_spec.rb +67 -0
- data/spec/integration/mailgun_spec.rb +4 -1
- data/spec/integration/suppressions_spec.rb +18 -2
- data/spec/spec_helper.rb +3 -1
- data/spec/unit/connection/test_client.rb +16 -0
- data/spec/unit/events/events_spec.rb +19 -0
- data/spec/unit/mailgun_spec.rb +24 -2
- data/spec/unit/messages/batch_message_spec.rb +56 -40
- data/spec/unit/messages/message_builder_spec.rb +165 -17
- data/spec/unit/messages/sample_data/unknown.type +0 -0
- data/spec/unit/railgun/content_type_spec.rb +71 -0
- data/spec/unit/railgun/mailer_spec.rb +388 -0
- data/vcr_cassettes/mailer_invalid_domain.yml +109 -0
- data/vcr_cassettes/message_deliver.yml +149 -0
- data/vcr_cassettes/suppressions.yml +66 -15
- metadata +50 -26
- data/.ruby-version +0 -1
@@ -49,7 +49,7 @@ http_interactions:
|
|
49
49
|
body:
|
50
50
|
encoding: UTF-8
|
51
51
|
string: '{"message":"4 addresses have been added to the bounces table"}'
|
52
|
-
http_version:
|
52
|
+
http_version:
|
53
53
|
recorded_at: Wed, 30 Nov 2016 20:53:49 GMT
|
54
54
|
- request:
|
55
55
|
method: delete
|
@@ -93,7 +93,7 @@ http_interactions:
|
|
93
93
|
encoding: UTF-8
|
94
94
|
string: '{"address":"test1@example.com","message":"Bounced address has been
|
95
95
|
removed"}'
|
96
|
-
http_version:
|
96
|
+
http_version:
|
97
97
|
recorded_at: Wed, 30 Nov 2016 20:53:49 GMT
|
98
98
|
- request:
|
99
99
|
method: delete
|
@@ -137,7 +137,7 @@ http_interactions:
|
|
137
137
|
encoding: UTF-8
|
138
138
|
string: '{"address":"test2@example.org","message":"Bounced address has been
|
139
139
|
removed"}'
|
140
|
-
http_version:
|
140
|
+
http_version:
|
141
141
|
recorded_at: Wed, 30 Nov 2016 20:53:50 GMT
|
142
142
|
- request:
|
143
143
|
method: delete
|
@@ -181,7 +181,7 @@ http_interactions:
|
|
181
181
|
encoding: UTF-8
|
182
182
|
string: '{"address":"test3@example.net","message":"Bounced address has been
|
183
183
|
removed"}'
|
184
|
-
http_version:
|
184
|
+
http_version:
|
185
185
|
recorded_at: Wed, 30 Nov 2016 20:53:50 GMT
|
186
186
|
- request:
|
187
187
|
method: delete
|
@@ -225,7 +225,7 @@ http_interactions:
|
|
225
225
|
encoding: UTF-8
|
226
226
|
string: '{"address":"test4@example.info","message":"Bounced address has been
|
227
227
|
removed"}'
|
228
|
-
http_version:
|
228
|
+
http_version:
|
229
229
|
recorded_at: Wed, 30 Nov 2016 20:53:50 GMT
|
230
230
|
- request:
|
231
231
|
method: post
|
@@ -274,7 +274,7 @@ http_interactions:
|
|
274
274
|
body:
|
275
275
|
encoding: UTF-8
|
276
276
|
string: '{"message":"4 addresses have been added to the unsubscribes table"}'
|
277
|
-
http_version:
|
277
|
+
http_version:
|
278
278
|
recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
|
279
279
|
- request:
|
280
280
|
method: delete
|
@@ -318,7 +318,7 @@ http_interactions:
|
|
318
318
|
encoding: UTF-8
|
319
319
|
string: '{"address":"test1@example.com","message":"Unsubscribe event has been
|
320
320
|
removed"}'
|
321
|
-
http_version:
|
321
|
+
http_version:
|
322
322
|
recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
|
323
323
|
- request:
|
324
324
|
method: delete
|
@@ -362,7 +362,7 @@ http_interactions:
|
|
362
362
|
encoding: UTF-8
|
363
363
|
string: '{"address":"test2@example.org","message":"Unsubscribe event has been
|
364
364
|
removed"}'
|
365
|
-
http_version:
|
365
|
+
http_version:
|
366
366
|
recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
|
367
367
|
- request:
|
368
368
|
method: delete
|
@@ -406,7 +406,7 @@ http_interactions:
|
|
406
406
|
encoding: UTF-8
|
407
407
|
string: '{"address":"test3@example.net","message":"Unsubscribe event has been
|
408
408
|
removed"}'
|
409
|
-
http_version:
|
409
|
+
http_version:
|
410
410
|
recorded_at: Wed, 30 Nov 2016 20:53:51 GMT
|
411
411
|
- request:
|
412
412
|
method: delete
|
@@ -450,7 +450,7 @@ http_interactions:
|
|
450
450
|
encoding: UTF-8
|
451
451
|
string: '{"address":"test4@example.info","message":"Unsubscribe event has been
|
452
452
|
removed"}'
|
453
|
-
http_version:
|
453
|
+
http_version:
|
454
454
|
recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
|
455
455
|
- request:
|
456
456
|
method: post
|
@@ -498,7 +498,7 @@ http_interactions:
|
|
498
498
|
encoding: UTF-8
|
499
499
|
string: '{"message":"4 complaint addresses have been added to the complaints
|
500
500
|
table"}'
|
501
|
-
http_version:
|
501
|
+
http_version:
|
502
502
|
recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
|
503
503
|
- request:
|
504
504
|
method: delete
|
@@ -541,7 +541,7 @@ http_interactions:
|
|
541
541
|
body:
|
542
542
|
encoding: UTF-8
|
543
543
|
string: '{"address":"test1@example.com","message":"Spam complaint has been removed"}'
|
544
|
-
http_version:
|
544
|
+
http_version:
|
545
545
|
recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
|
546
546
|
- request:
|
547
547
|
method: delete
|
@@ -584,7 +584,7 @@ http_interactions:
|
|
584
584
|
body:
|
585
585
|
encoding: UTF-8
|
586
586
|
string: '{"address":"test2@example.org","message":"Spam complaint has been removed"}'
|
587
|
-
http_version:
|
587
|
+
http_version:
|
588
588
|
recorded_at: Wed, 30 Nov 2016 20:53:52 GMT
|
589
589
|
- request:
|
590
590
|
method: delete
|
@@ -627,7 +627,7 @@ http_interactions:
|
|
627
627
|
body:
|
628
628
|
encoding: UTF-8
|
629
629
|
string: '{"address":"test3@example.net","message":"Spam complaint has been removed"}'
|
630
|
-
http_version:
|
630
|
+
http_version:
|
631
631
|
recorded_at: Wed, 30 Nov 2016 20:53:53 GMT
|
632
632
|
- request:
|
633
633
|
method: delete
|
@@ -671,6 +671,57 @@ http_interactions:
|
|
671
671
|
encoding: UTF-8
|
672
672
|
string: '{"address":"test4@example.info","message":"Spam complaint has been
|
673
673
|
removed"}'
|
674
|
-
http_version:
|
674
|
+
http_version:
|
675
675
|
recorded_at: Wed, 30 Nov 2016 20:53:53 GMT
|
676
|
+
- request:
|
677
|
+
method: post
|
678
|
+
uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/unsubscribes
|
679
|
+
body:
|
680
|
+
encoding: UTF-8
|
681
|
+
string: '[{"address":"test4@example.info","tag":"integration"},{"address":"test3@example.net","tag":"integration"},{"address":"test2@example.org","tag":"integration"},{"address":"test1@example.com","tag":"integration"}]'
|
682
|
+
headers:
|
683
|
+
Accept:
|
684
|
+
- "*/*"
|
685
|
+
Accept-Encoding:
|
686
|
+
- gzip, deflate
|
687
|
+
User-Agent:
|
688
|
+
- rest-client/2.0.2 (darwin18.7.0 x86_64) ruby/2.5.7p206
|
689
|
+
Content-Type:
|
690
|
+
- application/json
|
691
|
+
Content-Length:
|
692
|
+
- '210'
|
693
|
+
Host:
|
694
|
+
- api.mailgun.net
|
695
|
+
response:
|
696
|
+
status:
|
697
|
+
code: 200
|
698
|
+
message: OK
|
699
|
+
headers:
|
700
|
+
Access-Control-Allow-Headers:
|
701
|
+
- Content-Type, x-requested-with
|
702
|
+
Access-Control-Allow-Methods:
|
703
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
704
|
+
Access-Control-Allow-Origin:
|
705
|
+
- "*"
|
706
|
+
Access-Control-Max-Age:
|
707
|
+
- '600'
|
708
|
+
Content-Type:
|
709
|
+
- application/json; charset=utf-8
|
710
|
+
Date:
|
711
|
+
- Tue, 04 Feb 2020 15:16:07 GMT
|
712
|
+
Server:
|
713
|
+
- nginx
|
714
|
+
Strict-Transport-Security:
|
715
|
+
- max-age=63072000; includeSubDomains
|
716
|
+
Content-Length:
|
717
|
+
- '68'
|
718
|
+
Connection:
|
719
|
+
- keep-alive
|
720
|
+
body:
|
721
|
+
encoding: UTF-8
|
722
|
+
string: '{"message":"4 addresses have been added to the unsubscribes table"}
|
723
|
+
|
724
|
+
'
|
725
|
+
http_version:
|
726
|
+
recorded_at: Tue, 04 Feb 2020 15:16:07 GMT
|
676
727
|
recorded_with: VCR 3.0.3
|
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
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailgun
|
@@ -9,120 +9,134 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 1.16.2
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 1.16.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 3.8.0
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 3.8.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 12.3.2
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 12.3.2
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: webmock
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 3.4.2
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 3.4.2
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: pry
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 0.11.3
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 0.11.3
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: vcr
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
90
|
+
version: 3.0.3
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
97
|
+
version: 3.0.3
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: simplecov
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
104
|
+
version: 0.16.1
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
111
|
+
version: 0.16.1
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rails
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: rest-client
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
|
-
- - "
|
130
|
+
- - ">="
|
117
131
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
132
|
+
version: 2.0.2
|
119
133
|
type: :runtime
|
120
134
|
prerelease: false
|
121
135
|
version_requirements: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
|
-
- - "
|
137
|
+
- - ">="
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
139
|
+
version: 2.0.2
|
126
140
|
description: Mailgun's Official Ruby SDK for interacting with the Mailgun API.
|
127
141
|
email: support@mailgunhq.com
|
128
142
|
executables: []
|
@@ -133,7 +147,6 @@ files:
|
|
133
147
|
- ".rubocop.yml"
|
134
148
|
- ".rubocop_todo.yml"
|
135
149
|
- ".ruby-env.yml.example"
|
136
|
-
- ".ruby-version"
|
137
150
|
- ".travis.yml"
|
138
151
|
- Gemfile
|
139
152
|
- LICENSE
|
@@ -147,6 +160,8 @@ files:
|
|
147
160
|
- docs/Snippets.md
|
148
161
|
- docs/Suppressions.md
|
149
162
|
- docs/Webhooks.md
|
163
|
+
- docs/railgun/Overview.md
|
164
|
+
- docs/railgun/Parameters.md
|
150
165
|
- lib/mailgun-ruby.rb
|
151
166
|
- lib/mailgun.rb
|
152
167
|
- lib/mailgun/address.rb
|
@@ -177,6 +192,7 @@ files:
|
|
177
192
|
- spec/integration/events_spec.rb
|
178
193
|
- spec/integration/list_members_spec.rb
|
179
194
|
- spec/integration/list_spec.rb
|
195
|
+
- spec/integration/mailer_spec.rb
|
180
196
|
- spec/integration/mailgun_spec.rb
|
181
197
|
- spec/integration/messages/sample_data/mime.txt
|
182
198
|
- spec/integration/routes_spec.rb
|
@@ -194,6 +210,9 @@ files:
|
|
194
210
|
- spec/unit/messages/sample_data/mailgun_icon.png
|
195
211
|
- spec/unit/messages/sample_data/mime.txt
|
196
212
|
- spec/unit/messages/sample_data/rackspace_logo.jpg
|
213
|
+
- spec/unit/messages/sample_data/unknown.type
|
214
|
+
- spec/unit/railgun/content_type_spec.rb
|
215
|
+
- spec/unit/railgun/mailer_spec.rb
|
197
216
|
- vcr_cassettes/bounces.yml
|
198
217
|
- vcr_cassettes/complaints.yml
|
199
218
|
- vcr_cassettes/domains.todo.yml
|
@@ -202,8 +221,10 @@ files:
|
|
202
221
|
- vcr_cassettes/events.yml
|
203
222
|
- vcr_cassettes/exceptions.yml
|
204
223
|
- vcr_cassettes/list_members.yml
|
224
|
+
- vcr_cassettes/mailer_invalid_domain.yml
|
205
225
|
- vcr_cassettes/mailing_list.todo.yml
|
206
226
|
- vcr_cassettes/mailing_list.yml
|
227
|
+
- vcr_cassettes/message_deliver.yml
|
207
228
|
- vcr_cassettes/routes.yml
|
208
229
|
- vcr_cassettes/send_message.yml
|
209
230
|
- vcr_cassettes/stats.yml
|
@@ -222,15 +243,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
222
243
|
requirements:
|
223
244
|
- - ">="
|
224
245
|
- !ruby/object:Gem::Version
|
225
|
-
version: 2.
|
246
|
+
version: 2.2.2
|
226
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
248
|
requirements:
|
228
249
|
- - ">="
|
229
250
|
- !ruby/object:Gem::Version
|
230
251
|
version: '0'
|
231
252
|
requirements: []
|
232
|
-
|
233
|
-
rubygems_version: 2.6.13
|
253
|
+
rubygems_version: 3.0.3
|
234
254
|
signing_key:
|
235
255
|
specification_version: 4
|
236
256
|
summary: Mailgun's Official Ruby SDK
|
@@ -243,6 +263,7 @@ test_files:
|
|
243
263
|
- spec/integration/events_spec.rb
|
244
264
|
- spec/integration/list_members_spec.rb
|
245
265
|
- spec/integration/list_spec.rb
|
266
|
+
- spec/integration/mailer_spec.rb
|
246
267
|
- spec/integration/mailgun_spec.rb
|
247
268
|
- spec/integration/messages/sample_data/mime.txt
|
248
269
|
- spec/integration/routes_spec.rb
|
@@ -260,3 +281,6 @@ test_files:
|
|
260
281
|
- spec/unit/messages/sample_data/mailgun_icon.png
|
261
282
|
- spec/unit/messages/sample_data/mime.txt
|
262
283
|
- spec/unit/messages/sample_data/rackspace_logo.jpg
|
284
|
+
- spec/unit/messages/sample_data/unknown.type
|
285
|
+
- spec/unit/railgun/content_type_spec.rb
|
286
|
+
- spec/unit/railgun/mailer_spec.rb
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0-p0
|