postmark 1.22.1 → 1.22.2
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/.ruby-version +1 -1
 - data/CHANGELOG.rdoc +4 -0
 - data/CONTRIBUTING.md +1 -1
 - data/Gemfile +4 -1
 - data/README.md +5 -1
 - data/VERSION +1 -1
 - data/lib/postmark/error.rb +4 -3
 - data/lib/postmark/version.rb +1 -1
 - data/postmark.gemspec +2 -2
 - data/spec/unit/postmark/error_spec.rb +13 -20
 - 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: 65048304ac65a25c53918528a483e99f0c74ea5474c11348c978d8fb732dc032
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3e90058072e9e549846850fb3c352e963cc7c32468792e10d37662a63b036f03
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b25f7ea69f5b3db0260ad29c70b464cf757ed2f3f3b9abb45383aa8c4239516cbc9132bc67200f56faa08563e5cfcf391be086d845bf5baf03223106dd3e7cae
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 7fefb6ced2722b022b27ed06bd5cde4c388e373cfc75995dfb549534618a48e7106281514f9c06d6aba280d472c8211b39a4bffcaff9e61f43aa5017b0a260f7
         
     | 
    
        data/.ruby-version
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ruby-2. 
     | 
| 
      
 1 
     | 
    
         
            +
            ruby-2.7.5
         
     | 
    
        data/CHANGELOG.rdoc
    CHANGED
    
    
    
        data/CONTRIBUTING.md
    CHANGED
    
    | 
         @@ -14,5 +14,5 @@ If you’d like to submit a pull request: 
     | 
|
| 
       14 
14 
     | 
    
         
             
            * Do not mess with rakefile, version, or history.
         
     | 
| 
       15 
15 
     | 
    
         
             
            * Update the CHANGELOG, list your changes under Unreleased.
         
     | 
| 
       16 
16 
     | 
    
         
             
            * Update the README if necessary.
         
     | 
| 
       17 
     | 
    
         
            -
            * Write short, descriptive commit messages, following the format used in  
     | 
| 
      
 17 
     | 
    
         
            +
            * Write short, descriptive commit messages, following the format used in the repo.
         
     | 
| 
       18 
18 
     | 
    
         
             
            * Send a pull request. Bonus points for topic branches.
         
     | 
    
        data/Gemfile
    CHANGED
    
    | 
         @@ -11,5 +11,8 @@ group :test do 
     | 
|
| 
       11 
11 
     | 
    
         
             
              gem 'mime-types'
         
     | 
| 
       12 
12 
     | 
    
         
             
              gem 'activesupport'
         
     | 
| 
       13 
13 
     | 
    
         
             
              gem 'i18n', '~> 0.6.0'
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              # To support Ruby version <= 2.6
         
     | 
| 
      
 16 
     | 
    
         
            +
              gem 'minitest', '<= 5.15.0'
         
     | 
| 
      
 17 
     | 
    
         
            +
              gem 'yajl-ruby', '<= 1.4.1', :platforms => [:mingw, :mswin, :ruby]
         
     | 
| 
       15 
18 
     | 
    
         
             
            end
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -11,7 +11,7 @@ 
     | 
|
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
            Postmark allows you to send your emails with high delivery rates. It also includes detailed statistics. In addition, Postmark can parse incoming emails which are forwarded back to your application.
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
            This gem is the official wrapper for the [Postmark HTTP API]( 
     | 
| 
      
 14 
     | 
    
         
            +
            This gem is the official wrapper for the [Postmark HTTP API](https://postmarkapp.com).
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
            ## Usage
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
         @@ -62,6 +62,10 @@ Please leave all comments, bugs, requests and issues on the Issues page. 
     | 
|
| 
       62 
62 
     | 
    
         
             
            The Postmark Ruby library is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) license.
         
     | 
| 
       63 
63 
     | 
    
         
             
            Refer to the [LICENSE](https://github.com/ActiveCampaign/postmark-gem/blob/main/LICENSE) file for more information.
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
      
 65 
     | 
    
         
            +
            ## Tests
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
            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`.
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
       65 
69 
     | 
    
         
             
            ## Copyright
         
     | 
| 
       66 
70 
     | 
    
         | 
| 
       67 
71 
     | 
    
         
             
            Copyright © 2022 ActiveCampaign LLC.
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            1.22. 
     | 
| 
      
 1 
     | 
    
         
            +
            1.22.2
         
     | 
    
        data/lib/postmark/error.rb
    CHANGED
    
    | 
         @@ -75,9 +75,10 @@ module Postmark 
     | 
|
| 
       75 
75 
     | 
    
         
             
              class InactiveRecipientError < ApiInputError
         
     | 
| 
       76 
76 
     | 
    
         
             
                attr_reader :recipients
         
     | 
| 
       77 
77 
     | 
    
         | 
| 
       78 
     | 
    
         
            -
                PATTERNS = [ 
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
      
 78 
     | 
    
         
            +
                PATTERNS = [
         
     | 
| 
      
 79 
     | 
    
         
            +
                  /Found inactive addresses: (.+?)\. Inactive/,
         
     | 
| 
      
 80 
     | 
    
         
            +
                  /these inactive addresses: (.+?)\.?$/
         
     | 
| 
      
 81 
     | 
    
         
            +
                ].freeze
         
     | 
| 
       81 
82 
     | 
    
         | 
| 
       82 
83 
     | 
    
         
             
                def self.parse_recipients(message)
         
     | 
| 
       83 
84 
     | 
    
         
             
                  PATTERNS.each do |p|
         
     | 
    
        data/lib/postmark/version.rb
    CHANGED
    
    
    
        data/postmark.gemspec
    CHANGED
    
    | 
         @@ -5,7 +5,7 @@ require "postmark/version" 
     | 
|
| 
       5 
5 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       6 
6 
     | 
    
         
             
              s.name             = "postmark"
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.version          = Postmark::VERSION
         
     | 
| 
       8 
     | 
    
         
            -
              s.homepage         = " 
     | 
| 
      
 8 
     | 
    
         
            +
              s.homepage         = "https://postmarkapp.com"
         
     | 
| 
       9 
9 
     | 
    
         
             
              s.platform         = Gem::Platform::RUBY
         
     | 
| 
       10 
10 
     | 
    
         
             
              s.license          = 'MIT'
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
         @@ -24,7 +24,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       24 
24 
     | 
    
         
             
              s.post_install_message = %q{
         
     | 
| 
       25 
25 
     | 
    
         
             
                ==================
         
     | 
| 
       26 
26 
     | 
    
         
             
                Thanks for installing the postmark gem. If you don't have an account, please
         
     | 
| 
       27 
     | 
    
         
            -
                sign up at  
     | 
| 
      
 27 
     | 
    
         
            +
                sign up at https://postmarkapp.com/.
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
                Review the README.md for implementation details and examples.
         
     | 
| 
       30 
30 
     | 
    
         
             
                ==================
         
     | 
| 
         @@ -186,26 +186,15 @@ describe(Postmark::InactiveRecipientError) do 
     | 
|
| 
       186 
186 
     | 
    
         | 
| 
       187 
187 
     | 
    
         
             
                context '1/1 inactive' do
         
     | 
| 
       188 
188 
     | 
    
         
             
                  let(:message) do
         
     | 
| 
       189 
     | 
    
         
            -
                     
     | 
| 
       190 
     | 
    
         
            -
                    "inactive.\nFound inactive addresses: #{recipients[0]}.\n" \
         
     | 
| 
       191 
     | 
    
         
            -
                    'Inactive recipients are ones that have generated a hard ' \
         
     | 
| 
       192 
     | 
    
         
            -
                    'bounce or a spam complaint.'
         
     | 
| 
      
 189 
     | 
    
         
            +
                    all_recipients_inactive_message(recipients[0])
         
     | 
| 
       193 
190 
     | 
    
         
             
                  end
         
     | 
| 
       194 
191 
     | 
    
         | 
| 
       195 
192 
     | 
    
         
             
                  it {is_expected.to eq(recipients.take(1))}
         
     | 
| 
       196 
193 
     | 
    
         
             
                end
         
     | 
| 
       197 
194 
     | 
    
         | 
| 
       198 
     | 
    
         
            -
                context 'i/n inactive, n > 1, i < n - new message format' do
         
     | 
| 
       199 
     | 
    
         
            -
                  let(:message) { "Message OK, but will not deliver to these inactive addresses: #{recipients[0...2].join(', ')}" }
         
     | 
| 
       200 
     | 
    
         
            -
             
     | 
| 
       201 
     | 
    
         
            -
                  it {is_expected.to eq(recipients.take(2))}
         
     | 
| 
       202 
     | 
    
         
            -
                end
         
     | 
| 
       203 
     | 
    
         
            -
             
     | 
| 
       204 
195 
     | 
    
         
             
                context 'i/n inactive, n > 1, i < n' do
         
     | 
| 
       205 
196 
     | 
    
         
             
                  let(:message) do
         
     | 
| 
       206 
     | 
    
         
            -
                    ' 
     | 
| 
       207 
     | 
    
         
            -
                    "#{recipients[0...2].join(', ')}. Inactive recipients are ones that " \
         
     | 
| 
       208 
     | 
    
         
            -
                    'have generated a hard bounce or a spam complaint.'
         
     | 
| 
      
 197 
     | 
    
         
            +
                    some_recipients_inactive_message(recipients[0...2].join(', '))
         
     | 
| 
       209 
198 
     | 
    
         
             
                  end
         
     | 
| 
       210 
199 
     | 
    
         | 
| 
       211 
200 
     | 
    
         
             
                  it {is_expected.to eq(recipients.take(2))}
         
     | 
| 
         @@ -213,9 +202,7 @@ describe(Postmark::InactiveRecipientError) do 
     | 
|
| 
       213 
202 
     | 
    
         | 
| 
       214 
203 
     | 
    
         
             
                context 'n/n inactive, n > 1' do
         
     | 
| 
       215 
204 
     | 
    
         
             
                  let(:message) do
         
     | 
| 
       216 
     | 
    
         
            -
                    ' 
     | 
| 
       217 
     | 
    
         
            -
                    "inactive.\nFound inactive addresses: #{recipients.join(', ')}.\n" \
         
     | 
| 
       218 
     | 
    
         
            -
                    'Inactive recipients are ones that have generated a hard bounce or a spam complaint.'
         
     | 
| 
      
 205 
     | 
    
         
            +
                    all_recipients_inactive_message(recipients.join(', '))
         
     | 
| 
       219 
206 
     | 
    
         
             
                  end
         
     | 
| 
       220 
207 
     | 
    
         | 
| 
       221 
208 
     | 
    
         
             
                  it {is_expected.to eq(recipients)}
         
     | 
| 
         @@ -240,10 +227,7 @@ describe(Postmark::InactiveRecipientError) do 
     | 
|
| 
       240 
227 
     | 
    
         
             
                end
         
     | 
| 
       241 
228 
     | 
    
         | 
| 
       242 
229 
     | 
    
         
             
                let(:message) do
         
     | 
| 
       243 
     | 
    
         
            -
                   
     | 
| 
       244 
     | 
    
         
            -
                  "inactive.\nFound inactive addresses: #{address}.\n" \
         
     | 
| 
       245 
     | 
    
         
            -
                  'Inactive recipients are ones that have generated a hard ' \
         
     | 
| 
       246 
     | 
    
         
            -
                  'bounce or a spam complaint.'
         
     | 
| 
      
 230 
     | 
    
         
            +
                  all_recipients_inactive_message(address)
         
     | 
| 
       247 
231 
     | 
    
         
             
                end
         
     | 
| 
       248 
232 
     | 
    
         | 
| 
       249 
233 
     | 
    
         
             
                it 'parses recipients from json payload' do
         
     | 
| 
         @@ -262,6 +246,15 @@ describe(Postmark::InactiveRecipientError) do 
     | 
|
| 
       262 
246 
     | 
    
         
             
                  expect(subject.error_code).to eq(Postmark::ApiInputError::INACTIVE_RECIPIENT)
         
     | 
| 
       263 
247 
     | 
    
         
             
                end
         
     | 
| 
       264 
248 
     | 
    
         
             
              end
         
     | 
| 
      
 249 
     | 
    
         
            +
             
     | 
| 
      
 250 
     | 
    
         
            +
              def some_recipients_inactive_message(addresses)
         
     | 
| 
      
 251 
     | 
    
         
            +
               "Message OK, but will not deliver to these inactive addresses: #{addresses}."
         
     | 
| 
      
 252 
     | 
    
         
            +
              end
         
     | 
| 
      
 253 
     | 
    
         
            +
             
     | 
| 
      
 254 
     | 
    
         
            +
              def all_recipients_inactive_message(addresses)
         
     | 
| 
      
 255 
     | 
    
         
            +
                "You tried to send to recipient(s) that have been marked as inactive. Found inactive addresses: #{addresses}. " \
         
     | 
| 
      
 256 
     | 
    
         
            +
                "Inactive recipients are ones that have generated a hard bounce, a spam complaint, or a manual suppression."
         
     | 
| 
      
 257 
     | 
    
         
            +
              end
         
     | 
| 
       265 
258 
     | 
    
         
             
            end
         
     | 
| 
       266 
259 
     | 
    
         | 
| 
       267 
260 
     | 
    
         
             
            describe(Postmark::DeliveryError) 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.22. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.22.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Tomek Maszkowski
         
     | 
| 
         @@ -13,7 +13,7 @@ authors: 
     | 
|
| 
       13 
13 
     | 
    
         
             
            autorequire:
         
     | 
| 
       14 
14 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       15 
15 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       16 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 16 
     | 
    
         
            +
            date: 2022-11-22 00:00:00.000000000 Z
         
     | 
| 
       17 
17 
     | 
    
         
             
            dependencies:
         
     | 
| 
       18 
18 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       19 
19 
     | 
    
         
             
              name: json
         
     | 
| 
         @@ -129,12 +129,12 @@ files: 
     | 
|
| 
       129 
129 
     | 
    
         
             
            - spec/unit/postmark/mail_message_converter_spec.rb
         
     | 
| 
       130 
130 
     | 
    
         
             
            - spec/unit/postmark/message_extensions/mail_spec.rb
         
     | 
| 
       131 
131 
     | 
    
         
             
            - spec/unit/postmark_spec.rb
         
     | 
| 
       132 
     | 
    
         
            -
            homepage:  
     | 
| 
      
 132 
     | 
    
         
            +
            homepage: https://postmarkapp.com
         
     | 
| 
       133 
133 
     | 
    
         
             
            licenses:
         
     | 
| 
       134 
134 
     | 
    
         
             
            - MIT
         
     | 
| 
       135 
135 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       136 
136 
     | 
    
         
             
            post_install_message: "\n    ==================\n    Thanks for installing the postmark
         
     | 
| 
       137 
     | 
    
         
            -
              gem. If you don't have an account, please\n    sign up at  
     | 
| 
      
 137 
     | 
    
         
            +
              gem. If you don't have an account, please\n    sign up at https://postmarkapp.com/.\n\n
         
     | 
| 
       138 
138 
     | 
    
         
             
              \   Review the README.md for implementation details and examples.\n    ==================\n
         
     | 
| 
       139 
139 
     | 
    
         
             
              \ "
         
     | 
| 
       140 
140 
     | 
    
         
             
            rdoc_options:
         
     | 
| 
         @@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       152 
152 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       153 
153 
     | 
    
         
             
                  version: 1.3.7
         
     | 
| 
       154 
154 
     | 
    
         
             
            requirements: []
         
     | 
| 
       155 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 155 
     | 
    
         
            +
            rubygems_version: 3.1.6
         
     | 
| 
       156 
156 
     | 
    
         
             
            signing_key:
         
     | 
| 
       157 
157 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       158 
158 
     | 
    
         
             
            summary: Official Postmark API wrapper.
         
     |