postmark 1.24.0 → 1.24.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/CHANGELOG.rdoc +3 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/postmark/bounce.rb +5 -1
- data/lib/postmark/message_extensions/mail.rb +6 -6
- data/lib/postmark/version.rb +1 -1
- data/spec/unit/postmark/bounce_spec.rb +10 -0
- data/spec/unit/postmark/mail_message_converter_spec.rb +1 -1
- data/spec/unit/postmark/message_extensions/mail_spec.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a058959694917a357c1620516b215963717924485075b241ce7ceb23115619bd
|
4
|
+
data.tar.gz: 672e034cbbaa506c5bca5ae7acc229a190d88abb061461f3ddb4e6613c8b2b0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4161edf7a3ef04545b54824271677f618ac691c3dc6c332d7f507585b338fd2878572b8f4e12102367266a5226b64d758f6a1ff26e426040c9c538b710ee622f
|
7
|
+
data.tar.gz: af9c996569b7e3a3b31bb37f2623803877ec84179fb8f791a53002730b513919077ad26e28e3fa544b0b1cff60b276d9d762966901ffdfbcf015080f59145b3c
|
data/CHANGELOG.rdoc
CHANGED
data/README.md
CHANGED
@@ -73,8 +73,8 @@ Refer to the [LICENSE](https://github.com/ActiveCampaign/postmark-gem/blob/main/
|
|
73
73
|
|
74
74
|
## Tests
|
75
75
|
|
76
|
-
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`.
|
76
|
+
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`.
|
77
77
|
|
78
78
|
## Copyright
|
79
79
|
|
80
|
-
Copyright ©
|
80
|
+
Copyright © 2023 ActiveCampaign LLC.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.24.
|
1
|
+
1.24.1
|
data/lib/postmark/bounce.rb
CHANGED
@@ -3,7 +3,8 @@ require 'time'
|
|
3
3
|
module Postmark
|
4
4
|
class Bounce
|
5
5
|
|
6
|
-
attr_reader :email, :bounced_at, :type, :description, :details, :name, :id, :server_id, :tag, :message_id, :subject
|
6
|
+
attr_reader :email, :bounced_at, :type, :description, :details, :name, :id, :server_id, :tag, :message_id, :subject,
|
7
|
+
:message_stream, :content
|
7
8
|
|
8
9
|
def initialize(values = {})
|
9
10
|
values = Postmark::HashHelper.to_ruby(values)
|
@@ -20,6 +21,9 @@ module Postmark
|
|
20
21
|
@can_activate = values[:can_activate]
|
21
22
|
@message_id = values[:message_id]
|
22
23
|
@subject = values[:subject]
|
24
|
+
@server_id = values[:server_id]
|
25
|
+
@message_stream = values[:message_stream]
|
26
|
+
@content = values[:content]
|
23
27
|
end
|
24
28
|
|
25
29
|
def inactive?
|
@@ -171,12 +171,12 @@ module Mail
|
|
171
171
|
|
172
172
|
def export_native_attachments
|
173
173
|
attachments.map do |attachment|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
174
|
+
{
|
175
|
+
"Name" => attachment.filename,
|
176
|
+
"Content" => pack_attachment_data(attachment.body.decoded),
|
177
|
+
"ContentType" => attachment.content_type,
|
178
|
+
"ContentID" => attachment.inline? ? attachment.url : nil
|
179
|
+
}.delete_if { |_k, v| v.nil? }
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
data/lib/postmark/version.rb
CHANGED
@@ -12,6 +12,10 @@ describe Postmark::Bounce do
|
|
12
12
|
:inactive => false,
|
13
13
|
:can_activate => true,
|
14
14
|
:id => 42,
|
15
|
+
:server_id => 12345,
|
16
|
+
:tag => "TEST_TAG",
|
17
|
+
:message_stream => "my-message-stream",
|
18
|
+
:content => "THE CONTENT",
|
15
19
|
:subject => "Hello from our app!"} }
|
16
20
|
let(:bounce_data_postmark) { Postmark::HashHelper.to_postmark(bounce_data) }
|
17
21
|
let(:bounces_data) { [bounce_data, bounce_data, bounce_data] }
|
@@ -31,6 +35,8 @@ describe Postmark::Bounce do
|
|
31
35
|
it { expect(subject).to respond_to(:tag) }
|
32
36
|
it { expect(subject).to respond_to(:message_id) }
|
33
37
|
it { expect(subject).to respond_to(:subject) }
|
38
|
+
it { expect(subject).to respond_to(:message_stream) }
|
39
|
+
it { expect(subject).to respond_to(:content) }
|
34
40
|
end
|
35
41
|
|
36
42
|
context "given a bounce created from bounce_data" do
|
@@ -55,6 +61,10 @@ describe Postmark::Bounce do
|
|
55
61
|
its(:bounced_at) { is_expected.to eq Time.parse(bounce_data[:bounced_at]) }
|
56
62
|
its(:id) { is_expected.to eq bounce_data[:id] }
|
57
63
|
its(:subject) { is_expected.to eq bounce_data[:subject] }
|
64
|
+
its(:message_stream) { is_expected.to eq bounce_data[:message_stream] }
|
65
|
+
its(:server_id) { is_expected.to eq bounce_data[:server_id] }
|
66
|
+
its(:tag) { is_expected.to eq bounce_data[:tag] }
|
67
|
+
its(:content) { is_expected.to eq bounce_data[:content] }
|
58
68
|
|
59
69
|
end
|
60
70
|
|
@@ -219,7 +219,7 @@ describe Postmark::MailMessageConverter do
|
|
219
219
|
"Subject" => "Hello!",
|
220
220
|
"Attachments" => [{"Name" => "empty.gif",
|
221
221
|
"Content" => encoded_empty_gif_data,
|
222
|
-
"ContentType" => "image/gif"}],
|
222
|
+
"ContentType" => "image/gif; filename=empty.gif"}],
|
223
223
|
"TextBody" => "Hello Sheldon!",
|
224
224
|
"To" => "lenard@bigbangtheory.com"})
|
225
225
|
end
|
@@ -183,7 +183,7 @@ describe Mail::Message do
|
|
183
183
|
let(:exported_data) {
|
184
184
|
{'Name' => 'face.jpeg',
|
185
185
|
'Content' => "YmluYXJ5ZGF0YWhlcmU=\n",
|
186
|
-
'ContentType' => 'image/jpeg'}
|
186
|
+
'ContentType' => 'image/jpeg; filename=face.jpeg'}
|
187
187
|
}
|
188
188
|
|
189
189
|
context 'given a regular attachment' do
|
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.24.
|
4
|
+
version: 1.24.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomek Maszkowski
|
@@ -10,10 +10,10 @@ authors:
|
|
10
10
|
- Nick Hammond
|
11
11
|
- Petyo Ivanov
|
12
12
|
- Ilya Sabanin
|
13
|
-
autorequire:
|
13
|
+
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2023-
|
16
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: json
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
version: '0'
|
60
60
|
description: Use this gem to send emails through Postmark HTTP API and retrieve info
|
61
61
|
about bounces.
|
62
|
-
email:
|
62
|
+
email:
|
63
63
|
executables: []
|
64
64
|
extensions: []
|
65
65
|
extra_rdoc_files:
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: 1.3.7
|
155
155
|
requirements: []
|
156
156
|
rubygems_version: 3.1.6
|
157
|
-
signing_key:
|
157
|
+
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Official Postmark API wrapper.
|
160
160
|
test_files:
|