postmark 1.21.1 → 1.21.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +68 -0
- data/CHANGELOG.rdoc +16 -0
- data/README.md +3 -2
- data/RELEASE.md +12 -0
- data/VERSION +1 -1
- data/lib/postmark/api_client.rb +10 -1
- data/lib/postmark/http_client.rb +2 -3
- data/lib/postmark/message_extensions/mail.rb +6 -2
- data/lib/postmark/version.rb +1 -1
- data/postmark.gemspec +2 -2
- data/spec/unit/postmark/api_client_spec.rb +77 -13
- data/spec/unit/postmark/http_client_spec.rb +5 -5
- data/spec/unit/postmark/mail_message_converter_spec.rb +21 -17
- metadata +12 -8
- data/.travis.yml +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f37af7becb4542a52b09dac6ddbf4f8dd9a0e8865f58c09d09d589a4df99d52
|
4
|
+
data.tar.gz: b1f0853ddb0d5df6ed028b73f838cc23ed4438955280c3374b94bb4d4dd1d002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fff0cb52f3fa2368e7e930b480cc020a5f7783c5b946be06b39537f4c4673c191b7861083ddadfdbed395767377ad885c8ef218f8af6801cb3d9e84fdf94826
|
7
|
+
data.tar.gz: e649bf1192c4669f22622427cf986f6b53369f0a0c1c0bf3e97b6e782b6c4400d53b2d2e06f87cf2c24d853317c601c8b72c3a607f6b23ac7142fa517c566799
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# In order for builds to pass, in CircleCI you must have following environment variables setub:
|
2
|
+
# POSTMARK_API_KEY,POSTMARK_ACCOUNT_API_KEY,POSTMARK_CI_RECIPIENT,POSTMARK_CI_SENDER
|
3
|
+
|
4
|
+
version: 2.1
|
5
|
+
|
6
|
+
workflows:
|
7
|
+
ruby-tests:
|
8
|
+
jobs:
|
9
|
+
- unit-tests:
|
10
|
+
matrix:
|
11
|
+
parameters:
|
12
|
+
version: ["2", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7"]
|
13
|
+
- unit-tests-legacy:
|
14
|
+
matrix:
|
15
|
+
parameters:
|
16
|
+
version: ["kneip/ree-1.8.7-2012.02","ruby:1.9.3","circleci/jruby:9"]
|
17
|
+
|
18
|
+
orbs:
|
19
|
+
ruby: circleci/ruby@0.1.2
|
20
|
+
|
21
|
+
jobs:
|
22
|
+
unit-tests:
|
23
|
+
parallelism: 1
|
24
|
+
parameters:
|
25
|
+
version:
|
26
|
+
type: string
|
27
|
+
docker:
|
28
|
+
- image: circleci/ruby:<< parameters.version >>
|
29
|
+
steps:
|
30
|
+
- checkout
|
31
|
+
- run:
|
32
|
+
name: Versions
|
33
|
+
command: |
|
34
|
+
echo "ruby: $(ruby --version)"
|
35
|
+
|
36
|
+
- run:
|
37
|
+
name: Install dependencies
|
38
|
+
command: bundle install
|
39
|
+
|
40
|
+
- run:
|
41
|
+
name: Run tests
|
42
|
+
command: bundle exec rake spec
|
43
|
+
|
44
|
+
unit-tests-legacy:
|
45
|
+
parallelism: 1
|
46
|
+
environment:
|
47
|
+
BUNDLE_GEMFILE: ./gemfiles/Gemfile.legacy
|
48
|
+
parameters:
|
49
|
+
version:
|
50
|
+
type: string
|
51
|
+
docker:
|
52
|
+
- image: << parameters.version >>
|
53
|
+
steps:
|
54
|
+
- checkout
|
55
|
+
- run:
|
56
|
+
name: Versions
|
57
|
+
command: |
|
58
|
+
echo "ruby: $(ruby --version)"
|
59
|
+
|
60
|
+
- run:
|
61
|
+
name: Install dependencies
|
62
|
+
command: |
|
63
|
+
gem install bundler --version 1.17.3
|
64
|
+
bundle install
|
65
|
+
|
66
|
+
- run:
|
67
|
+
name: Run tests
|
68
|
+
command: bundle exec rake spec
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
|
+
== 1.21.5
|
4
|
+
|
5
|
+
* Added support for archiving/unarchiving message streams
|
6
|
+
|
7
|
+
== 1.21.4
|
8
|
+
|
9
|
+
* Fixed Postmark::ApiClient#deliver_messages_with_templates (#104)
|
10
|
+
|
11
|
+
== 1.21.3
|
12
|
+
|
13
|
+
* Remove default SSL version setting and rely on Net::HTTP/OpenSSL default.
|
14
|
+
|
15
|
+
== 1.21.2
|
16
|
+
|
17
|
+
* Ensure sending via message stream uses the correct message stream
|
18
|
+
|
3
19
|
== 1.21.1
|
4
20
|
|
5
21
|
* Fixed Postmark::ApiClient#get_message_streams
|
data/README.md
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
</a>
|
4
4
|
|
5
5
|
# Postmark Ruby Gem
|
6
|
-
[![Build Status](https://
|
6
|
+
[![Build Status](https://circleci.com/gh/wildbit/postmark-gem.svg?style=shield)](https://circleci.com/gh/wildbit/postmark-gem)
|
7
|
+
[![Code Climate](https://codeclimate.com/github/wildbit/postmark-gem/badges/gpa.svg)](https://codeclimate.com/github/wildbit/postmark-gem)
|
7
8
|
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://www.opensource.org/licenses/MIT)
|
8
9
|
[![Gem Version](https://badge.fury.io/rb/postmark.svg)](https://badge.fury.io/rb/postmark)
|
9
10
|
|
@@ -62,4 +63,4 @@ Refer to the [LICENSE](https://github.com/wildbit/postmark-gem/blob/master/LICEN
|
|
62
63
|
|
63
64
|
## Copyright
|
64
65
|
|
65
|
-
Copyright ©
|
66
|
+
Copyright © 2021 Wildbit LLC.
|
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 CircleCI 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.21.4
|
data/lib/postmark/api_client.rb
CHANGED
@@ -81,7 +81,8 @@ module Postmark
|
|
81
81
|
end
|
82
82
|
|
83
83
|
in_batches(messages) do |batch, offset|
|
84
|
-
|
84
|
+
mapped = batch.map { |m| m.to_postmark_hash }
|
85
|
+
data = serialize(:Messages => mapped)
|
85
86
|
|
86
87
|
with_retries do
|
87
88
|
http_client.post("email/batchWithTemplates", data).tap do |response|
|
@@ -351,6 +352,14 @@ module Postmark
|
|
351
352
|
format_response(http_client.patch("message-streams/#{id}", data))
|
352
353
|
end
|
353
354
|
|
355
|
+
def archive_message_stream(id)
|
356
|
+
format_response http_client.post("message-streams/#{id}/archive")
|
357
|
+
end
|
358
|
+
|
359
|
+
def unarchive_message_stream(id)
|
360
|
+
format_response http_client.post("message-streams/#{id}/unarchive")
|
361
|
+
end
|
362
|
+
|
354
363
|
def dump_suppressions(stream_id, options = {})
|
355
364
|
_, batch = load_batch("message-streams/#{stream_id}/suppressions/dump", 'Suppressions', options)
|
356
365
|
batch
|
data/lib/postmark/http_client.rb
CHANGED
@@ -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
|
-
|
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
data/postmark.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.license = 'MIT'
|
11
11
|
|
12
|
-
s.authors = ["
|
13
|
-
s.email = "
|
12
|
+
s.authors = ["Tomek Maszkowski", "Igor Balos", "Artem Chistyakov", "Nick Hammond", "Petyo Ivanov", "Ilya Sabanin"]
|
13
|
+
s.email = "tomek@wildbit.com"
|
14
14
|
s.extra_rdoc_files = ["LICENSE", "README.md"]
|
15
15
|
s.rdoc_options = ["--charset=UTF-8"]
|
16
16
|
|
@@ -201,7 +201,7 @@ describe Postmark::ApiClient do
|
|
201
201
|
describe "#deliver_messages_with_templates" do
|
202
202
|
let(:email) {templated_message.to_postmark_hash}
|
203
203
|
let(:emails) {[email, email, email]}
|
204
|
-
let(:emails_json) {Postmark::Json.encode(emails)}
|
204
|
+
let(:emails_json) {Postmark::Json.encode(:Messages => emails)}
|
205
205
|
let(:response) {[{}, {}, {}]}
|
206
206
|
let(:messages) { Array.new(3) { templated_message } }
|
207
207
|
|
@@ -606,10 +606,14 @@ describe Postmark::ApiClient do
|
|
606
606
|
end
|
607
607
|
|
608
608
|
describe "#server_info" do
|
609
|
-
let(:response) {
|
610
|
-
|
611
|
-
|
612
|
-
|
609
|
+
let(:response) {
|
610
|
+
{
|
611
|
+
"Name" => "Testing",
|
612
|
+
"Color" => "blue",
|
613
|
+
"InboundHash" => "c2425d77f74f8643e5f6237438086c81",
|
614
|
+
"SmtpApiActivated" => true
|
615
|
+
}
|
616
|
+
}
|
613
617
|
|
614
618
|
it 'requests server info from Postmark and converts it to ruby format' do
|
615
619
|
expect(http_client).to receive(:get).with('server') {response}
|
@@ -618,10 +622,14 @@ describe Postmark::ApiClient do
|
|
618
622
|
end
|
619
623
|
|
620
624
|
describe "#update_server_info" do
|
621
|
-
let(:response) {
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
+
let(:response) {
|
626
|
+
{
|
627
|
+
"Name" => "Testing",
|
628
|
+
"Color" => "blue",
|
629
|
+
"InboundHash" => "c2425d77f74f8643e5f6237438086c81",
|
630
|
+
"SmtpApiActivated" => false
|
631
|
+
}
|
632
|
+
}
|
625
633
|
let(:update) {{:smtp_api_activated => false}}
|
626
634
|
|
627
635
|
it 'updates server info in Postmark and converts it to ruby format' do
|
@@ -1086,10 +1094,10 @@ describe Postmark::ApiClient do
|
|
1086
1094
|
specify do
|
1087
1095
|
expect(http_client).to receive(:post).
|
1088
1096
|
with('message-streams',
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1097
|
+
json_representation_of({
|
1098
|
+
'Name' => 'My Stream',
|
1099
|
+
'Id' => 'my-stream',
|
1100
|
+
'MessageStreamType' => 'Broadcasts'
|
1093
1101
|
}))
|
1094
1102
|
subject
|
1095
1103
|
end
|
@@ -1148,6 +1156,62 @@ describe Postmark::ApiClient do
|
|
1148
1156
|
}
|
1149
1157
|
end
|
1150
1158
|
|
1159
|
+
describe '#archive_message_stream' do
|
1160
|
+
subject { api_client.archive_message_stream(stream_id) }
|
1161
|
+
|
1162
|
+
let(:stream_id) { 'my-stream'}
|
1163
|
+
let(:server_id) { 123 }
|
1164
|
+
let(:purge_date) { '2030-08-30T12:30:00.00-04:00' }
|
1165
|
+
let(:api_endpoint) { "message-streams/#{stream_id}/archive" }
|
1166
|
+
let(:api_response) {{ 'ID' => stream_id, 'ServerID' => server_id, 'ExpectedPurgeDate' => purge_date }}
|
1167
|
+
|
1168
|
+
before do
|
1169
|
+
allow(http_client).to receive(:post).with(api_endpoint) { api_response }
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
it 'calls the API endpoint' do
|
1173
|
+
expect(http_client).to receive(:post).with(api_endpoint)
|
1174
|
+
subject
|
1175
|
+
end
|
1176
|
+
|
1177
|
+
it 'transforms the API response' do
|
1178
|
+
expect(subject).to eq({ :id => stream_id, :server_id => server_id, :expected_purge_date => purge_date })
|
1179
|
+
end
|
1180
|
+
end
|
1181
|
+
|
1182
|
+
describe '#unarchive_message_stream' do
|
1183
|
+
subject { api_client.unarchive_message_stream(stream_id) }
|
1184
|
+
|
1185
|
+
let(:stream_id) { 'my-stream'}
|
1186
|
+
let(:server_id) { 123 }
|
1187
|
+
let(:api_endpoint) { "message-streams/#{stream_id}/unarchive" }
|
1188
|
+
let(:api_response) {
|
1189
|
+
{ 'ID' => stream_id, 'ServerID' => server_id, 'Name' => 'My Stream',
|
1190
|
+
'Description' => 'My test stream.', 'MessageStreamType' => 'Transactional',
|
1191
|
+
'CreatedAt' => '2030-08-30T12:30:00.00-04:00', 'UpdatedAt' => '2030-09-30T12:30:00.00-04:00',
|
1192
|
+
'ArchivedAt'=> nil, 'ExpectedPurgeDate' => nil,
|
1193
|
+
'SubscriptionManagementConfiguration' => { 'UnsubscribeHandlingType' => 'None' } }
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
before do
|
1197
|
+
allow(http_client).to receive(:post).with(api_endpoint) { api_response }
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
it 'calls the API endpoint' do
|
1201
|
+
expect(http_client).to receive(:post).with(api_endpoint)
|
1202
|
+
subject
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
it 'transforms the API response' do
|
1206
|
+
expect(subject).to eq({ :id => stream_id, :server_id => server_id, :name => 'My Stream',
|
1207
|
+
:description => 'My test stream.', :message_stream_type => 'Transactional',
|
1208
|
+
:created_at => '2030-08-30T12:30:00.00-04:00',
|
1209
|
+
:updated_at => '2030-09-30T12:30:00.00-04:00',
|
1210
|
+
:archived_at => nil , :expected_purge_date => nil ,
|
1211
|
+
:subscription_management_configuration => { 'UnsubscribeHandlingType' => 'None' }})
|
1212
|
+
end
|
1213
|
+
end
|
1214
|
+
|
1151
1215
|
describe '#create_suppressions' do
|
1152
1216
|
let(:email_addresses) { nil }
|
1153
1217
|
let(:message_stream_id) { 'outbound' }
|
@@ -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 '
|
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
|
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.
|
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,19 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Tomek Maszkowski
|
8
|
+
- Igor Balos
|
9
|
+
- Artem Chistyakov
|
10
|
+
- Nick Hammond
|
7
11
|
- Petyo Ivanov
|
8
12
|
- Ilya Sabanin
|
9
|
-
|
10
|
-
autorequire:
|
13
|
+
autorequire:
|
11
14
|
bindir: bin
|
12
15
|
cert_chain: []
|
13
|
-
date:
|
16
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
14
17
|
dependencies:
|
15
18
|
- !ruby/object:Gem::Dependency
|
16
19
|
name: json
|
@@ -56,23 +59,24 @@ dependencies:
|
|
56
59
|
version: '0'
|
57
60
|
description: Use this gem to send emails through Postmark HTTP API and retrieve info
|
58
61
|
about bounces.
|
59
|
-
email:
|
62
|
+
email: tomek@wildbit.com
|
60
63
|
executables: []
|
61
64
|
extensions: []
|
62
65
|
extra_rdoc_files:
|
63
66
|
- LICENSE
|
64
67
|
- README.md
|
65
68
|
files:
|
69
|
+
- ".circleci/config.yml"
|
66
70
|
- ".document"
|
67
71
|
- ".gitignore"
|
68
72
|
- ".rake_tasks"
|
69
73
|
- ".rspec"
|
70
|
-
- ".travis.yml"
|
71
74
|
- CHANGELOG.rdoc
|
72
75
|
- CONTRIBUTING.md
|
73
76
|
- Gemfile
|
74
77
|
- LICENSE
|
75
78
|
- README.md
|
79
|
+
- RELEASE.md
|
76
80
|
- Rakefile
|
77
81
|
- VERSION
|
78
82
|
- gemfiles/Gemfile.legacy
|
@@ -146,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
150
|
- !ruby/object:Gem::Version
|
147
151
|
version: 1.3.7
|
148
152
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
150
|
-
signing_key:
|
153
|
+
rubygems_version: 3.2.3
|
154
|
+
signing_key:
|
151
155
|
specification_version: 4
|
152
156
|
summary: Official Postmark API wrapper.
|
153
157
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
env:
|
2
|
-
global:
|
3
|
-
# POSTMARK_API_KEY=?
|
4
|
-
- secure: "ee7WQAGh7zOcoLYYx1k+542cU2R9jovnypCgyKTaBWMtdes3He4NksJGgp3PSgiPOjpYiqncXYZitgo/gKL8cYjtgcP8o/TKbzmHMTHEbD2LRWfIJ6sr4DiGYT1sjKvTLhVhSIh+WVcIXK9X3V5e6VIUfo14RMj6owHD6qv8Bjc="
|
5
|
-
# POSTMARK_ACCOUNT_API_KEY=?
|
6
|
-
- secure: "lau1m+ws6T5LBiRXwd+Q0b20Wjh62W/nHnCmzOSZc2+V97XTldl3MCJdXNV7J6X7O9CzFabcAG8FSbGGwPRiyhY/qhxkYSc/9pWE8RUjyCjbw5q2RzZQelMKizyKU92eOjd6jQw/wDSZcww1OceW/pgdRjqEo21Pk6XH2yzLAd8="
|
7
|
-
# POSTMARK_CI_RECIPIENT=?
|
8
|
-
- secure: "YnccT2MM+hIfwxl1WtcTk48q+D9XY7p6FTHkeJbUoaT9PFXQqXyUCQpwk5wYAwzZbVWG/CgH4PitWyRbWBP6kAqYKlsnAkQip0FNjs0DbK0SH9YvcFFSDZsTAl9yfwSxlgnBZHGZ49LO3yISMPUOdNn1QmaF4Ndpl4hiycH7UA8="
|
9
|
-
# POSTMARK_CI_SENDER=?
|
10
|
-
- secure: "Cz/KfiXkd90GQr+47LunlZnal8clrRpKmZUd9K161RYd5bfkL+P6SnEmhMprwdzomUBqIcqleR9HjmECey2V/Zd9V8vtBaLVZ5CoeMTkz3Tu6SllfmpymkcuJKf7GGizs97gmhPMlJd9iMukL6eqW4/1C9HW0cLZFB/jlzqFHpE="
|
11
|
-
language: ruby
|
12
|
-
rvm:
|
13
|
-
- 2.0.0
|
14
|
-
- 2.1.9
|
15
|
-
- 2.2.5
|
16
|
-
- 2.3.1
|
17
|
-
- 2.5.7
|
18
|
-
- 2.6.5
|
19
|
-
- 2.7.0
|
20
|
-
matrix:
|
21
|
-
include:
|
22
|
-
- rvm: 1.8.7
|
23
|
-
dist: precise
|
24
|
-
gemfile: gemfiles/Gemfile.legacy
|
25
|
-
- rvm: 1.9.3
|
26
|
-
gemfile: gemfiles/Gemfile.legacy
|
27
|
-
- rvm: jruby-19mode
|
28
|
-
jdk: oraclejdk8
|
29
|
-
dist: trusty
|
30
|
-
gemfile: gemfiles/Gemfile.legacy
|
31
|
-
script: bundle exec rake spec
|