mailgun-ruby 1.2.9 → 1.2.11
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/.rubocop.yml +0 -0
- data/.rubocop_todo.yml +0 -0
- data/.ruby-env.yml.example +0 -0
- data/README.md +3 -2
- data/lib/mailgun/chains.rb +0 -0
- data/lib/mailgun/client.rb +3 -3
- data/lib/mailgun/domains/domains.rb +0 -0
- data/lib/mailgun/response.rb +0 -0
- data/lib/mailgun/version.rb +1 -1
- data/lib/mailgun/webhooks/webhooks.rb +2 -2
- data/spec/integration/bounces_spec.rb +0 -0
- data/spec/integration/campaign_spec.rb +0 -0
- data/spec/integration/complaints_spec.rb +0 -0
- data/spec/integration/domains_spec.rb +0 -0
- data/spec/integration/email_validation_spec.rb +0 -0
- data/spec/integration/events_spec.rb +0 -0
- data/spec/integration/list_members_spec.rb +0 -0
- data/spec/integration/list_spec.rb +0 -0
- data/spec/integration/mailgun_spec.rb +0 -0
- data/spec/integration/routes_spec.rb +0 -0
- data/spec/integration/stats_spec.rb +0 -0
- data/spec/integration/suppressions_spec.rb +0 -0
- data/spec/integration/unsubscribes_spec.rb +0 -0
- data/spec/integration/webhook_spec.rb +0 -0
- data/spec/unit/connection/test_client.rb +2 -2
- data/vcr_cassettes/bounces.yml +0 -0
- data/vcr_cassettes/complaints.yml +0 -0
- data/vcr_cassettes/domains.todo.yml +0 -0
- data/vcr_cassettes/domains.yml +0 -0
- data/vcr_cassettes/events.yml +0 -0
- data/vcr_cassettes/list_members.yml +0 -0
- data/vcr_cassettes/mailing_list.todo.yml +0 -0
- data/vcr_cassettes/mailing_list.yml +0 -0
- data/vcr_cassettes/routes.yml +0 -0
- data/vcr_cassettes/send_message.yml +0 -0
- data/vcr_cassettes/stats.yml +0 -0
- data/vcr_cassettes/unsubscribes.yml +0 -0
- data/vcr_cassettes/webhooks.yml +0 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17aa99cf0b68c595bdc9a923368c206da53c5eb2798d4a4faf9def78d9216129
|
4
|
+
data.tar.gz: ede5046e9ddb743b5eadff56da85a7b32049c6c6451895442f4356675c946cc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b57eb3df8f031b360871555f05681f4f585df44973844369f54f4acc0331e34977813275a36dab485d3b3c3268ce2a56d456c4b292bfd90399d226da1c66f5
|
7
|
+
data.tar.gz: 99d18ff767e314c436891d4a56aa05e7037618c7aa03f3fc28d6be69ad41e49a58744f02024f94376ab9e69f0250ae3455e54d41f9b939da80cba64550ec71ea
|
data/.rubocop.yml
CHANGED
File without changes
|
data/.rubocop_todo.yml
CHANGED
File without changes
|
data/.ruby-env.yml.example
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ gem install mailgun-ruby
|
|
19
19
|
Gemfile:
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
gem 'mailgun-ruby', '~>1.2.
|
22
|
+
gem 'mailgun-ruby', '~>1.2.11'
|
23
23
|
```
|
24
24
|
|
25
25
|
Usage
|
@@ -81,6 +81,7 @@ and replace `api-myapikey` and `mydomain.com` with your secret API key and domai
|
|
81
81
|
api_key: 'api-myapikey',
|
82
82
|
domain: 'mydomain.com',
|
83
83
|
# api_host: 'api.eu.mailgun.net' # Uncomment this line for EU region domains
|
84
|
+
# timeout: 20 # Default depends on rest-client, whose default is 60s. Added in 1.2.3.
|
84
85
|
}
|
85
86
|
```
|
86
87
|
|
@@ -96,7 +97,7 @@ class UserMailer < ApplicationMailer
|
|
96
97
|
}
|
97
98
|
end
|
98
99
|
end
|
99
|
-
end
|
100
|
+
end
|
100
101
|
```
|
101
102
|
|
102
103
|
To get the Mailgun `message_id` after ActionMailer has successfully delivered the email:
|
data/lib/mailgun/chains.rb
CHANGED
File without changes
|
data/lib/mailgun/client.rb
CHANGED
@@ -205,7 +205,7 @@ module Mailgun
|
|
205
205
|
#
|
206
206
|
# @param [StandardException] e upstream exception object
|
207
207
|
def communication_error(e)
|
208
|
-
if e.respond_to?(:response)
|
208
|
+
if e.respond_to?(:response) && e.response
|
209
209
|
return case e.response.code
|
210
210
|
when Unauthorized::CODE
|
211
211
|
Unauthorized.new(e.message, e.response)
|
@@ -222,11 +222,11 @@ module Mailgun
|
|
222
222
|
message = data.respond_to?(:message) ? data.message : data
|
223
223
|
fail ParameterError.new('Missing working domain', working_domain) unless working_domain
|
224
224
|
fail ParameterError.new(
|
225
|
-
'Missing `to` recipient, message should
|
225
|
+
'Missing `to` recipient, message should contain at least 1 recipient',
|
226
226
|
working_domain
|
227
227
|
) if message.fetch('to', []).empty? && message.fetch(:to, []).empty?
|
228
228
|
fail ParameterError.new(
|
229
|
-
'Missing a `from` sender, message should
|
229
|
+
'Missing a `from` sender, message should contain at least 1 `from` sender',
|
230
230
|
working_domain
|
231
231
|
) if message.fetch('from', []).empty? && message.fetch(:from, []).empty?
|
232
232
|
end
|
File without changes
|
data/lib/mailgun/response.rb
CHANGED
File without changes
|
data/lib/mailgun/version.rb
CHANGED
@@ -58,7 +58,7 @@ module Mailgun
|
|
58
58
|
#
|
59
59
|
# Returns true or false
|
60
60
|
def create_all(domain, url = '')
|
61
|
-
%w(
|
61
|
+
%w(accepted clicked complained delivered opened permanent_fail temporary_fail unsubscribed).each do |action|
|
62
62
|
add_webhook domain, action, url
|
63
63
|
end
|
64
64
|
true
|
@@ -90,7 +90,7 @@ module Mailgun
|
|
90
90
|
# Returns a Boolean on the success
|
91
91
|
def remove_all(domain)
|
92
92
|
fail Mailgun::ParameterError('Domain not provided to remove webhooks from') unless domain
|
93
|
-
%w(
|
93
|
+
%w(accepted clicked complained delivered opened permanent_fail temporary_fail unsubscribed).each do |action|
|
94
94
|
delete_webhook domain, action
|
95
95
|
end
|
96
96
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -83,11 +83,11 @@ module Mailgun
|
|
83
83
|
message = data.respond_to?(:message) ? data.message : data
|
84
84
|
|
85
85
|
fail ParameterError.new(
|
86
|
-
'Missing `to` recipient, message should
|
86
|
+
'Missing `to` recipient, message should contain at least 1 recipient',
|
87
87
|
working_domain
|
88
88
|
) if message.fetch('to', []).empty? && message.fetch(:to, []).empty?
|
89
89
|
fail ParameterError.new(
|
90
|
-
'Missing a `from` sender, message should
|
90
|
+
'Missing a `from` sender, message should contain at least 1 `from` sender',
|
91
91
|
working_domain
|
92
92
|
) if message.fetch('from', []).empty? && message.fetch(:from, []).empty?
|
93
93
|
end
|
data/vcr_cassettes/bounces.yml
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/vcr_cassettes/domains.yml
CHANGED
File without changes
|
data/vcr_cassettes/events.yml
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/vcr_cassettes/routes.yml
CHANGED
File without changes
|
File without changes
|
data/vcr_cassettes/stats.yml
CHANGED
File without changes
|
File without changes
|
data/vcr_cassettes/webhooks.yml
CHANGED
File without changes
|
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.2.
|
4
|
+
version: 1.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailgun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -254,8 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
- !ruby/object:Gem::Version
|
255
255
|
version: '0'
|
256
256
|
requirements: []
|
257
|
-
|
258
|
-
rubygems_version: 2.7.6
|
257
|
+
rubygems_version: 3.0.3
|
259
258
|
signing_key:
|
260
259
|
specification_version: 4
|
261
260
|
summary: Mailgun's Official Ruby SDK
|