postmark 1.24.0 → 1.24.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36d183adb014f24f30c12f04f65d01d9a4565e46bac544fcf499f1834d98b15f
4
- data.tar.gz: 23d80a64a061b7bce98a7040a0b64b7e56611aea995894764d201e5ee71fdf69
3
+ metadata.gz: a058959694917a357c1620516b215963717924485075b241ce7ceb23115619bd
4
+ data.tar.gz: 672e034cbbaa506c5bca5ae7acc229a190d88abb061461f3ddb4e6613c8b2b0f
5
5
  SHA512:
6
- metadata.gz: a132d891995e587fc6324cbed9626799a7919f0314b4402910593e47afb02281b25fd6b8971a20197774dd37d48c7221389047699b9cbf98a2cdfecce3e247b6
7
- data.tar.gz: 26b78de0eefb4c6055e2edee3f787ddab17c49f49fbbd4e8bf02100f85202cc46d57ff4c140617f0c1cd7c325875e602fc952c8b9a528a9ad9feed25ee9d76b1
6
+ metadata.gz: 4161edf7a3ef04545b54824271677f618ac691c3dc6c332d7f507585b338fd2878572b8f4e12102367266a5226b64d758f6a1ff26e426040c9c538b710ee622f
7
+ data.tar.gz: af9c996569b7e3a3b31bb37f2623803877ec84179fb8f791a53002730b513919077ad26e28e3fa544b0b1cff60b276d9d762966901ffdfbcf015080f59145b3c
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,8 @@
1
1
  = Changelog
2
2
 
3
+ == 1.24.1
4
+ * Fixed support for text/calendar attachments by using content_type instead of mime_type.
5
+
3
6
  == 1.24.0
4
7
  * Added configurable warnings when referencing deprecated classes.
5
8
 
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`. The credentials for it can be found in the internal 1password vault under `Postmark - Ruby - Client Library - Account`.
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 © 2022 ActiveCampaign LLC.
80
+ Copyright © 2023 ActiveCampaign LLC.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.24.0
1
+ 1.24.1
@@ -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
- basics = {"Name" => attachment.filename,
175
- "Content" => pack_attachment_data(attachment.body.decoded),
176
- "ContentType" => attachment.mime_type}
177
- specials = attachment.inline? ? {'ContentID' => attachment.url} : {}
178
-
179
- basics.update(specials)
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
 
@@ -1,3 +1,3 @@
1
1
  module Postmark
2
- VERSION = '1.24.0'
2
+ VERSION = '1.24.1'
3
3
  end
@@ -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.0
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-04-07 00:00:00.000000000 Z
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: