postmark 1.22.1 → 1.22.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.rdoc +7 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +4 -1
- data/README.md +5 -1
- data/VERSION +1 -1
- data/lib/postmark/error.rb +4 -3
- data/lib/postmark/http_client.rb +2 -2
- data/lib/postmark/version.rb +1 -1
- data/postmark.gemspec +3 -3
- data/spec/unit/postmark/error_spec.rb +13 -20
- data/spec/unit/postmark/http_client_spec.rb +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef3cc236986909ab3ad5351bb3642a525f5d0a7826a270d35e9eadde0f37021b
|
4
|
+
data.tar.gz: 824731c2567364402cc9866c0f0da8abcbd974809fb9e237238c8581da72f8f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ef7a11422e2415ec69c1614d77a12d89b3b2fd94f7ba5d9ddb56c6e7671b4213de9b1480c8840125f65ef00eadbca6f56e265fcf9dd5ae82d17f224f56f1a98
|
7
|
+
data.tar.gz: c3d90f8162206e6174bc9edd141164a8349288f36504e019d69a34a7eb8d1aa822d71e80319bfdef22cf028fde5b9f6d0ae5b4d9b866f054a55a481164c1c4ff
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.7.5
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
|
+
== 1.22.3
|
4
|
+
* Increased default timeout values
|
5
|
+
|
6
|
+
== 1.22.2
|
7
|
+
* Updated Postmark::InactiveRecipientError.parse_recipients method to handle current error message
|
8
|
+
* Update post install message to use https URL
|
9
|
+
|
3
10
|
== 1.22.1
|
4
11
|
* Migrated to ActiveCampaign
|
5
12
|
|
data/CONTRIBUTING.md
CHANGED
@@ -14,5 +14,5 @@ If you’d like to submit a pull request:
|
|
14
14
|
* Do not mess with rakefile, version, or history.
|
15
15
|
* Update the CHANGELOG, list your changes under Unreleased.
|
16
16
|
* Update the README if necessary.
|
17
|
-
* Write short, descriptive commit messages, following the format used in
|
17
|
+
* Write short, descriptive commit messages, following the format used in the repo.
|
18
18
|
* Send a pull request. Bonus points for topic branches.
|
data/Gemfile
CHANGED
@@ -11,5 +11,8 @@ group :test do
|
|
11
11
|
gem 'mime-types'
|
12
12
|
gem 'activesupport'
|
13
13
|
gem 'i18n', '~> 0.6.0'
|
14
|
-
|
14
|
+
|
15
|
+
# To support Ruby version <= 2.6
|
16
|
+
gem 'minitest', '<= 5.15.0'
|
17
|
+
gem 'yajl-ruby', '<= 1.4.1', :platforms => [:mingw, :mswin, :ruby]
|
15
18
|
end
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
Postmark allows you to send your emails with high delivery rates. It also includes detailed statistics. In addition, Postmark can parse incoming emails which are forwarded back to your application.
|
13
13
|
|
14
|
-
This gem is the official wrapper for the [Postmark HTTP API](
|
14
|
+
This gem is the official wrapper for the [Postmark HTTP API](https://postmarkapp.com).
|
15
15
|
|
16
16
|
## Usage
|
17
17
|
|
@@ -62,6 +62,10 @@ Please leave all comments, bugs, requests and issues on the Issues page.
|
|
62
62
|
The Postmark Ruby library is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) license.
|
63
63
|
Refer to the [LICENSE](https://github.com/ActiveCampaign/postmark-gem/blob/main/LICENSE) file for more information.
|
64
64
|
|
65
|
+
## Tests
|
66
|
+
|
67
|
+
The [integration tests](https://github.com/ActiveCampaign/postmark-gem/tree/main/spec/integration) currently use a real test email address, configured via `POSTMARK_CI_RECIPIENT`. The credentials for it can be found in the internal 1password vault under `Postmark - Ruby - Client Library - Account`.
|
68
|
+
|
65
69
|
## Copyright
|
66
70
|
|
67
71
|
Copyright © 2022 ActiveCampaign LLC.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.22.
|
1
|
+
1.22.3
|
data/lib/postmark/error.rb
CHANGED
@@ -75,9 +75,10 @@ module Postmark
|
|
75
75
|
class InactiveRecipientError < ApiInputError
|
76
76
|
attr_reader :recipients
|
77
77
|
|
78
|
-
PATTERNS = [
|
79
|
-
|
80
|
-
|
78
|
+
PATTERNS = [
|
79
|
+
/Found inactive addresses: (.+?)\. Inactive/,
|
80
|
+
/these inactive addresses: (.+?)\.?$/
|
81
|
+
].freeze
|
81
82
|
|
82
83
|
def self.parse_recipients(message)
|
83
84
|
PATTERNS.each do |p|
|
data/lib/postmark/http_client.rb
CHANGED
@@ -17,8 +17,8 @@ module Postmark
|
|
17
17
|
:host => 'api.postmarkapp.com',
|
18
18
|
:secure => true,
|
19
19
|
:path_prefix => '/',
|
20
|
-
:http_read_timeout =>
|
21
|
-
:http_open_timeout =>
|
20
|
+
:http_read_timeout => 60,
|
21
|
+
:http_open_timeout => 60
|
22
22
|
}
|
23
23
|
|
24
24
|
def initialize(api_token, options = {})
|
data/lib/postmark/version.rb
CHANGED
data/postmark.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "postmark/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "postmark"
|
7
7
|
s.version = Postmark::VERSION
|
8
|
-
s.homepage = "
|
8
|
+
s.homepage = "https://postmarkapp.com"
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.license = 'MIT'
|
11
11
|
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.post_install_message = %q{
|
25
25
|
==================
|
26
26
|
Thanks for installing the postmark gem. If you don't have an account, please
|
27
|
-
sign up at
|
27
|
+
sign up at https://postmarkapp.com/.
|
28
28
|
|
29
29
|
Review the README.md for implementation details and examples.
|
30
30
|
==================
|
@@ -34,6 +34,6 @@ Gem::Specification.new do |s|
|
|
34
34
|
|
35
35
|
s.add_dependency "json"
|
36
36
|
|
37
|
-
s.add_development_dependency "mail"
|
37
|
+
s.add_development_dependency "mail", "~> 2.7.0" # https://github.com/mikel/mail/pull/1539
|
38
38
|
s.add_development_dependency "rake"
|
39
39
|
end
|
@@ -186,26 +186,15 @@ describe(Postmark::InactiveRecipientError) do
|
|
186
186
|
|
187
187
|
context '1/1 inactive' do
|
188
188
|
let(:message) do
|
189
|
-
|
190
|
-
"inactive.\nFound inactive addresses: #{recipients[0]}.\n" \
|
191
|
-
'Inactive recipients are ones that have generated a hard ' \
|
192
|
-
'bounce or a spam complaint.'
|
189
|
+
all_recipients_inactive_message(recipients[0])
|
193
190
|
end
|
194
191
|
|
195
192
|
it {is_expected.to eq(recipients.take(1))}
|
196
193
|
end
|
197
194
|
|
198
|
-
context 'i/n inactive, n > 1, i < n - new message format' do
|
199
|
-
let(:message) { "Message OK, but will not deliver to these inactive addresses: #{recipients[0...2].join(', ')}" }
|
200
|
-
|
201
|
-
it {is_expected.to eq(recipients.take(2))}
|
202
|
-
end
|
203
|
-
|
204
195
|
context 'i/n inactive, n > 1, i < n' do
|
205
196
|
let(:message) do
|
206
|
-
'
|
207
|
-
"#{recipients[0...2].join(', ')}. Inactive recipients are ones that " \
|
208
|
-
'have generated a hard bounce or a spam complaint.'
|
197
|
+
some_recipients_inactive_message(recipients[0...2].join(', '))
|
209
198
|
end
|
210
199
|
|
211
200
|
it {is_expected.to eq(recipients.take(2))}
|
@@ -213,9 +202,7 @@ describe(Postmark::InactiveRecipientError) do
|
|
213
202
|
|
214
203
|
context 'n/n inactive, n > 1' do
|
215
204
|
let(:message) do
|
216
|
-
'
|
217
|
-
"inactive.\nFound inactive addresses: #{recipients.join(', ')}.\n" \
|
218
|
-
'Inactive recipients are ones that have generated a hard bounce or a spam complaint.'
|
205
|
+
all_recipients_inactive_message(recipients.join(', '))
|
219
206
|
end
|
220
207
|
|
221
208
|
it {is_expected.to eq(recipients)}
|
@@ -240,10 +227,7 @@ describe(Postmark::InactiveRecipientError) do
|
|
240
227
|
end
|
241
228
|
|
242
229
|
let(:message) do
|
243
|
-
|
244
|
-
"inactive.\nFound inactive addresses: #{address}.\n" \
|
245
|
-
'Inactive recipients are ones that have generated a hard ' \
|
246
|
-
'bounce or a spam complaint.'
|
230
|
+
all_recipients_inactive_message(address)
|
247
231
|
end
|
248
232
|
|
249
233
|
it 'parses recipients from json payload' do
|
@@ -262,6 +246,15 @@ describe(Postmark::InactiveRecipientError) do
|
|
262
246
|
expect(subject.error_code).to eq(Postmark::ApiInputError::INACTIVE_RECIPIENT)
|
263
247
|
end
|
264
248
|
end
|
249
|
+
|
250
|
+
def some_recipients_inactive_message(addresses)
|
251
|
+
"Message OK, but will not deliver to these inactive addresses: #{addresses}."
|
252
|
+
end
|
253
|
+
|
254
|
+
def all_recipients_inactive_message(addresses)
|
255
|
+
"You tried to send to recipient(s) that have been marked as inactive. Found inactive addresses: #{addresses}. " \
|
256
|
+
"Inactive recipients are ones that have generated a hard bounce, a spam complaint, or a manual suppression."
|
257
|
+
end
|
265
258
|
end
|
266
259
|
|
267
260
|
describe(Postmark::DeliveryError) do
|
@@ -39,8 +39,8 @@ describe Postmark::HttpClient do
|
|
39
39
|
its(:port) { is_expected.to eq 443 }
|
40
40
|
its(:secure) { is_expected.to be true }
|
41
41
|
its(:path_prefix) { is_expected.to eq '/' }
|
42
|
-
its(:http_read_timeout) { is_expected.to eq
|
43
|
-
its(:http_open_timeout) { is_expected.to eq
|
42
|
+
its(:http_read_timeout) { is_expected.to eq 60 }
|
43
|
+
its(:http_open_timeout) { is_expected.to eq 60 }
|
44
44
|
|
45
45
|
it 'does not provide a default which utilizes the Net::HTTP default', :skip_ruby_version => ['1.8.7'] do
|
46
46
|
http_client = subject.http
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.22.
|
4
|
+
version: 1.22.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomek Maszkowski
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2023-01-16 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: json
|
@@ -33,16 +33,16 @@ dependencies:
|
|
33
33
|
name: mail
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- - "
|
36
|
+
- - "~>"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
38
|
+
version: 2.7.0
|
39
39
|
type: :development
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
|
-
- - "
|
43
|
+
- - "~>"
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 2.7.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rake
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,12 +129,12 @@ files:
|
|
129
129
|
- spec/unit/postmark/mail_message_converter_spec.rb
|
130
130
|
- spec/unit/postmark/message_extensions/mail_spec.rb
|
131
131
|
- spec/unit/postmark_spec.rb
|
132
|
-
homepage:
|
132
|
+
homepage: https://postmarkapp.com
|
133
133
|
licenses:
|
134
134
|
- MIT
|
135
135
|
metadata: {}
|
136
136
|
post_install_message: "\n ==================\n Thanks for installing the postmark
|
137
|
-
gem. If you don't have an account, please\n sign up at
|
137
|
+
gem. If you don't have an account, please\n sign up at https://postmarkapp.com/.\n\n
|
138
138
|
\ Review the README.md for implementation details and examples.\n ==================\n
|
139
139
|
\ "
|
140
140
|
rdoc_options:
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: 1.3.7
|
154
154
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
155
|
+
rubygems_version: 3.1.6
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Official Postmark API wrapper.
|