postmark 1.21.1 → 1.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/postmark/message_extensions/mail.rb +6 -2
- data/lib/postmark/version.rb +1 -1
- data/spec/unit/postmark/api_client_spec.rb +4 -4
- data/spec/unit/postmark/mail_message_converter_spec.rb +21 -17
- 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: 968a770c1ef1003b30c635a730caed027ed4579fae5a4c7ab8644996d2925440
|
4
|
+
data.tar.gz: 824ebb1f5ca038484a5077108df96cbbed072829c2dfd6fbc634f29d299e1675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a0bd9ac21b0a25fc377d70dd8d28c07dcb02886f51465d0879d2f1bb24bf8c5628cfc396b6cf6244f3a252fe5e17f7d7d4c10020764036884c1a9b99f3cf0b
|
7
|
+
data.tar.gz: 732d2a94875cfa132167aca0fcbd551279610a88d87fab34f23a116a568b0ba738e825e09b0b366ed8cb48e2c6bcd2d1b786d08ee8b1e93b35f3f172d911eee1
|
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.21.
|
1
|
+
1.21.2
|
@@ -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
|
-
|
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
|
|
data/lib/postmark/version.rb
CHANGED
@@ -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
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1089
|
+
json_representation_of({
|
1090
|
+
'Name' => 'My Stream',
|
1091
|
+
'Id' => 'my-stream',
|
1092
|
+
'MessageStreamType' => 'Broadcasts'
|
1093
1093
|
}))
|
1094
1094
|
subject
|
1095
1095
|
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.
|
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
|
384
|
+
before do
|
385
|
+
mail_message.message_stream = 'weekly-newsletter'
|
386
|
+
end
|
385
387
|
|
386
|
-
|
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.
|
4
|
+
version: 1.21.2
|
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-
|
13
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -146,8 +146,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: 1.3.7
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
150
|
-
signing_key:
|
149
|
+
rubygems_version: 3.1.4
|
150
|
+
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Official Postmark API wrapper.
|
153
153
|
test_files:
|