postmark 1.21.1 → 1.21.3

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: 4059e97def9c50a4070433c6f2232431627c9c72f43aba77c5bb1844df107708
4
- data.tar.gz: 29454f806e17cdf57885a091035faea0354049ae9da78b81d8f40549fe276e76
3
+ metadata.gz: fb0f51e437e4831ac7fe011e089ac51c00984a614f48f31e94cce6233331f3bd
4
+ data.tar.gz: 599f2b99b5a8bca7a5761c560feddac36cd252a2232431008c3eabc1ef3375b0
5
5
  SHA512:
6
- metadata.gz: d9576dc4ed16f2b2926fae5a1ff7db1f87ea511f7f9dd7eb8a52d7690b5af84ddd79bd2f6e452196961378e65d9ff2c3a061003d1579430d2731fa20bad40d7d
7
- data.tar.gz: 8077ed204c8678179e6e2a1932342d76da52618acd8bdc9d8df5513ae973088b1820f9b6bd4ff5b2575b0736a0fb2600e02938cf490da06b05492634eef15b94
6
+ metadata.gz: 7f16405603d847f6e8b4124a7da3c478db38555196016d59cb743c4d63f154e512ffac6d9db74702340e19cfa2afdb04965fdcb3436ab92c62f031d2d2b7ba0b
7
+ data.tar.gz: 6429f12e770e5a305f2bcb705cff501c48ebeb45be85dbd78f44e32cc4b5312abd0d6d9789c5c29e7cb3fca411a4e1a748a34fdc35e703862202e7c72851a0be
data/.travis.yml CHANGED
@@ -5,9 +5,9 @@ env:
5
5
  # POSTMARK_ACCOUNT_API_KEY=?
6
6
  - secure: "lau1m+ws6T5LBiRXwd+Q0b20Wjh62W/nHnCmzOSZc2+V97XTldl3MCJdXNV7J6X7O9CzFabcAG8FSbGGwPRiyhY/qhxkYSc/9pWE8RUjyCjbw5q2RzZQelMKizyKU92eOjd6jQw/wDSZcww1OceW/pgdRjqEo21Pk6XH2yzLAd8="
7
7
  # POSTMARK_CI_RECIPIENT=?
8
- - secure: "YnccT2MM+hIfwxl1WtcTk48q+D9XY7p6FTHkeJbUoaT9PFXQqXyUCQpwk5wYAwzZbVWG/CgH4PitWyRbWBP6kAqYKlsnAkQip0FNjs0DbK0SH9YvcFFSDZsTAl9yfwSxlgnBZHGZ49LO3yISMPUOdNn1QmaF4Ndpl4hiycH7UA8="
8
+ - secure: "XJkpUbAC1N6vcL/bUvqX2Mx8OKXpr/3zwqhjGiWhrSGKmQJUNnK4TEGFjnb1TBncZvW5cBRD0oX1Tt7gAu4o8C6sldVf35hB5FQsEyQrgSN4s95uLHuTW9EQisiQS6kzPLbkUmsMIQhIlfNGKQ5tRzRQstip81E8a0Emth3Y9EQ="
9
9
  # POSTMARK_CI_SENDER=?
10
- - secure: "Cz/KfiXkd90GQr+47LunlZnal8clrRpKmZUd9K161RYd5bfkL+P6SnEmhMprwdzomUBqIcqleR9HjmECey2V/Zd9V8vtBaLVZ5CoeMTkz3Tu6SllfmpymkcuJKf7GGizs97gmhPMlJd9iMukL6eqW4/1C9HW0cLZFB/jlzqFHpE="
10
+ - secure: "bOoU3WEFur/SqwTY0m0aGqy8v8AZfZtFFHNYsU/BtAppZXj378CiktvJGj+cz/KMqFEWyJKNzchFOfZa45Q9Xor/QbTqkBriTOz3Ff7gQpmuPfLSvWRQSLRmbRFgr0Dk8QCTTtfnNtnajxMUyGfxwCiMo+l3EEAqjtLpN+Gja20="
11
11
  language: ruby
12
12
  rvm:
13
13
  - 2.0.0
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,13 @@
1
1
  = Changelog
2
2
 
3
+ == 1.21.3
4
+
5
+ * Remove default SSL version setting and rely on Net::HTTP/OpenSSL default.
6
+
7
+ == 1.21.2
8
+
9
+ * Ensure sending via message stream uses the correct message stream
10
+
3
11
  == 1.21.1
4
12
 
5
13
  * Fixed Postmark::ApiClient#get_message_streams
data/RELEASE.md ADDED
@@ -0,0 +1,12 @@
1
+ New versions of the gem are cut by the Postmark team, this is a quick guide to ensuring a smooth release.
2
+
3
+ 1. Verify all builds are passing on Travis for your branch.
4
+ 1. Merge in your branch to master.
5
+ 1. Update VERSION and lib/postmark/version.rb with the new version.
6
+ 1. Update CHANGELOG.rdoc with a brief description of the changes.
7
+ 1. Commit to git with a comment of "Bump version to x.y.z".
8
+ 1. run `rake release` - This will push to github(with the version tag) and rubygems with the version in lib/postmark/version.rb.
9
+ *Note that if you're on Bundler 1.17 there's a bug that hides the prompt for your OTP. If it hangs after adding the tag then it's asking for your OTP, enter your OTP and press Enter. Bundler 2.x and beyond resolved this issue. *
10
+ 1. Verify the new version is on [github](https://github.com/wildbit/postmark-gem) and [rubygems](https://rubygems.org/gems/postmark).
11
+ 1. Create a new release for the version on [Github releases](https://github.com/wildbit/postmark-gem/releases).
12
+ 1. Add or update any related content to the [wiki](https://github.com/wildbit/postmark-gem/wiki).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.21.1
1
+ 1.21.3
@@ -18,8 +18,7 @@ module Postmark
18
18
  :secure => true,
19
19
  :path_prefix => '/',
20
20
  :http_read_timeout => 15,
21
- :http_open_timeout => 5,
22
- :http_ssl_version => :TLSv1
21
+ :http_open_timeout => 5
23
22
  }
24
23
 
25
24
  def initialize(api_token, options = {})
@@ -107,7 +106,7 @@ module Postmark
107
106
  http.read_timeout = self.http_read_timeout
108
107
  http.open_timeout = self.http_open_timeout
109
108
  http.use_ssl = !!self.secure
110
- http.ssl_version = self.http_ssl_version if http.respond_to?(:ssl_version=)
109
+ http.ssl_version = self.http_ssl_version if self.http_ssl_version && http.respond_to?(:ssl_version=)
111
110
  http
112
111
  end
113
112
  end
@@ -72,10 +72,13 @@ module Mail
72
72
  @template_model = model
73
73
  end
74
74
 
75
- attr_writer :message_stream
76
75
  def message_stream(val = nil)
77
76
  self.message_stream = val unless val.nil?
78
- @message_stream
77
+ header['MESSAGE-STREAM'].to_s
78
+ end
79
+
80
+ def message_stream=(val)
81
+ header['MESSAGE-STREAM'] = val
79
82
  end
80
83
 
81
84
  def templated?
@@ -188,6 +191,7 @@ module Mail
188
191
  attachment to
189
192
  track-opens track-links
190
193
  postmark-template-alias
194
+ message-stream
191
195
  ]
192
196
  end
193
197
 
@@ -1,3 +1,3 @@
1
1
  module Postmark
2
- VERSION = '1.21.1'
2
+ VERSION = '1.21.3'
3
3
  end
@@ -1086,10 +1086,10 @@ describe Postmark::ApiClient do
1086
1086
  specify do
1087
1087
  expect(http_client).to receive(:post).
1088
1088
  with('message-streams',
1089
- match_json({
1090
- :Name => 'My Stream',
1091
- :Id => 'my-stream',
1092
- :MessageStreamType => 'Broadcasts'
1089
+ json_representation_of({
1090
+ 'Name' => 'My Stream',
1091
+ 'Id' => 'my-stream',
1092
+ 'MessageStreamType' => 'Broadcasts'
1093
1093
  }))
1094
1094
  subject
1095
1095
  end
@@ -42,9 +42,9 @@ describe Postmark::HttpClient do
42
42
  its(:http_read_timeout) { is_expected.to eq 15 }
43
43
  its(:http_open_timeout) { is_expected.to eq 5 }
44
44
 
45
- it 'use default TLS encryption', :skip_ruby_version => ['1.8.7'] do
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
47
- expect(http_client.ssl_version).to eq :TLSv1
47
+ expect(http_client.ssl_version).to eq nil
48
48
  end
49
49
  end
50
50
 
@@ -140,7 +140,7 @@ describe Postmark::HttpClient do
140
140
  :status => [ "485", "Custom HTTP response status" ])
141
141
  expect { subject.post(target_path) }.to raise_error Postmark::UnknownError
142
142
  end
143
-
143
+
144
144
  end
145
145
 
146
146
  describe "#get" do
@@ -180,7 +180,7 @@ describe Postmark::HttpClient do
180
180
  :status => [ "485", "Custom HTTP response status" ])
181
181
  expect { subject.get(target_path) }.to raise_error Postmark::UnknownError
182
182
  end
183
-
183
+
184
184
  end
185
185
 
186
186
  describe "#put" do
@@ -223,4 +223,4 @@ describe Postmark::HttpClient do
223
223
  expect { subject.put(target_path) }.to raise_error Postmark::UnknownError
224
224
  end
225
225
  end
226
- end
226
+ end
@@ -173,7 +173,7 @@ describe Postmark::MailMessageConverter do
173
173
  end
174
174
 
175
175
  it 'converts plain text messages correctly' do
176
- expect(subject.new(mail_message).run).to eq ({
176
+ expect(subject.new(mail_message).run).to eq({
177
177
  "From" => "sheldon@bigbangtheory.com",
178
178
  "Subject" => "Hello!",
179
179
  "TextBody" => "Hello Sheldon!",
@@ -181,7 +181,7 @@ describe Postmark::MailMessageConverter do
181
181
  end
182
182
 
183
183
  it 'converts tagged text messages correctly' do
184
- expect(subject.new(tagged_mail_message).run).to eq ({
184
+ expect(subject.new(tagged_mail_message).run).to eq({
185
185
  "From" => "sheldon@bigbangtheory.com",
186
186
  "Subject" => "Hello!",
187
187
  "TextBody" => "Hello Sheldon!",
@@ -190,14 +190,14 @@ describe Postmark::MailMessageConverter do
190
190
  end
191
191
 
192
192
  it 'converts plain text messages without body correctly' do
193
- expect(subject.new(mail_message_without_body).run).to eq ({
193
+ expect(subject.new(mail_message_without_body).run).to eq({
194
194
  "From" => "sheldon@bigbangtheory.com",
195
195
  "Subject" => "Hello!",
196
196
  "To" => "lenard@bigbangtheory.com"})
197
197
  end
198
198
 
199
199
  it 'converts html messages correctly' do
200
- expect(subject.new(mail_html_message).run).to eq ({
200
+ expect(subject.new(mail_html_message).run).to eq({
201
201
  "From" => "sheldon@bigbangtheory.com",
202
202
  "Subject" => "Hello!",
203
203
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -205,7 +205,7 @@ describe Postmark::MailMessageConverter do
205
205
  end
206
206
 
207
207
  it 'converts multipart messages correctly' do
208
- expect(subject.new(mail_multipart_message).run).to eq ({
208
+ expect(subject.new(mail_multipart_message).run).to eq({
209
209
  "From" => "sheldon@bigbangtheory.com",
210
210
  "Subject" => "Hello!",
211
211
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -214,7 +214,7 @@ describe Postmark::MailMessageConverter do
214
214
  end
215
215
 
216
216
  it 'converts messages with attachments correctly' do
217
- expect(subject.new(mail_message_with_attachment).run).to eq ({
217
+ expect(subject.new(mail_message_with_attachment).run).to eq({
218
218
  "From" => "sheldon@bigbangtheory.com",
219
219
  "Subject" => "Hello!",
220
220
  "Attachments" => [{"Name" => "empty.gif",
@@ -225,7 +225,7 @@ describe Postmark::MailMessageConverter do
225
225
  end
226
226
 
227
227
  it 'converts messages with named addresses correctly' do
228
- expect(subject.new(mail_message_with_named_addresses).run).to eq ({
228
+ expect(subject.new(mail_message_with_named_addresses).run).to eq({
229
229
  "From" => "Sheldon <sheldon@bigbangtheory.com>",
230
230
  "Subject" => "Hello!",
231
231
  "TextBody" => "Hello Sheldon!",
@@ -244,7 +244,7 @@ describe Postmark::MailMessageConverter do
244
244
  context 'open tracking' do
245
245
  context 'setup inside of mail' do
246
246
  it 'converts open tracking enabled messages correctly' do
247
- expect(subject.new(mail_message_with_open_tracking).run).to eq ({
247
+ expect(subject.new(mail_message_with_open_tracking).run).to eq({
248
248
  "From" => "sheldon@bigbangtheory.com",
249
249
  "Subject" => "Hello!",
250
250
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -253,7 +253,7 @@ describe Postmark::MailMessageConverter do
253
253
  end
254
254
 
255
255
  it 'converts open tracking disabled messages correctly' do
256
- expect(subject.new(mail_message_with_open_tracking_disabled).run).to eq ({
256
+ expect(subject.new(mail_message_with_open_tracking_disabled).run).to eq({
257
257
  "From" => "sheldon@bigbangtheory.com",
258
258
  "Subject" => "Hello!",
259
259
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -264,7 +264,7 @@ describe Postmark::MailMessageConverter do
264
264
 
265
265
  context 'setup with tracking variable' do
266
266
  it 'converts open tracking enabled messages correctly' do
267
- expect(subject.new(mail_message_with_open_tracking_set_variable).run).to eq ({
267
+ expect(subject.new(mail_message_with_open_tracking_set_variable).run).to eq({
268
268
  "From" => "sheldon@bigbangtheory.com",
269
269
  "Subject" => "Hello!",
270
270
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -273,7 +273,7 @@ describe Postmark::MailMessageConverter do
273
273
  end
274
274
 
275
275
  it 'converts open tracking disabled messages correctly' do
276
- expect(subject.new(mail_message_with_open_tracking_disabled_set_variable).run).to eq ({
276
+ expect(subject.new(mail_message_with_open_tracking_disabled_set_variable).run).to eq({
277
277
  "From" => "sheldon@bigbangtheory.com",
278
278
  "Subject" => "Hello!",
279
279
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -285,7 +285,7 @@ describe Postmark::MailMessageConverter do
285
285
 
286
286
  context 'link tracking' do
287
287
  it 'converts html and text link tracking enabled messages correctly' do
288
- expect(subject.new(mail_message_with_link_tracking_all).run).to eq ({
288
+ expect(subject.new(mail_message_with_link_tracking_all).run).to eq({
289
289
  "From" => "sheldon@bigbangtheory.com",
290
290
  "Subject" => "Hello!",
291
291
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -294,7 +294,7 @@ describe Postmark::MailMessageConverter do
294
294
  end
295
295
 
296
296
  it 'converts html only link tracking enabled messages correctly' do
297
- expect(subject.new(mail_message_with_link_tracking_html).run).to eq ({
297
+ expect(subject.new(mail_message_with_link_tracking_html).run).to eq({
298
298
  "From" => "sheldon@bigbangtheory.com",
299
299
  "Subject" => "Hello!",
300
300
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -303,7 +303,7 @@ describe Postmark::MailMessageConverter do
303
303
  end
304
304
 
305
305
  it 'converts text only link tracking enabled messages correctly' do
306
- expect(subject.new(mail_message_with_link_tracking_text).run).to eq ({
306
+ expect(subject.new(mail_message_with_link_tracking_text).run).to eq({
307
307
  "From" => "sheldon@bigbangtheory.com",
308
308
  "Subject" => "Hello!",
309
309
  "HtmlBody" => "<b>Hello Sheldon!</b>",
@@ -377,13 +377,17 @@ describe Postmark::MailMessageConverter do
377
377
 
378
378
  describe 'passing message stream' do
379
379
  context 'when not set' do
380
- specify { expect(mail_message.to_postmark_hash.keys).not_to include('MessageStream') }
380
+ specify { expect(subject.new(mail_message).run).not_to include('MessageStream') }
381
381
  end
382
382
 
383
383
  context 'when set' do
384
- before { mail_message.message_stream = 'weekly-newsletter' }
384
+ before do
385
+ mail_message.message_stream = 'weekly-newsletter'
386
+ end
385
387
 
386
- specify { expect(mail_message.to_postmark_hash).to include('MessageStream' => 'weekly-newsletter') }
388
+ it 'passes message stream to the API call' do
389
+ expect(subject.new(mail_message).run).to include('MessageStream' => 'weekly-newsletter')
390
+ end
387
391
  end
388
392
  end
389
393
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.1
4
+ version: 1.21.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petyo Ivanov
8
8
  - Ilya Sabanin
9
9
  - Artem Chistyakov
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-08 00:00:00.000000000 Z
13
+ date: 2020-12-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -73,6 +73,7 @@ files:
73
73
  - Gemfile
74
74
  - LICENSE
75
75
  - README.md
76
+ - RELEASE.md
76
77
  - Rakefile
77
78
  - VERSION
78
79
  - gemfiles/Gemfile.legacy
@@ -146,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  - !ruby/object:Gem::Version
147
148
  version: 1.3.7
148
149
  requirements: []
149
- rubygems_version: 3.0.6
150
- signing_key:
150
+ rubygems_version: 3.1.4
151
+ signing_key:
151
152
  specification_version: 4
152
153
  summary: Official Postmark API wrapper.
153
154
  test_files: