mailjet 1.8.1 → 1.8.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81b381ece7ddfd633298bbe9d65867cfffe22055847d72faef4c1e40f6d9c7ec
4
- data.tar.gz: ec5dc140da0fc4fc5384b22517d3bfc3d8335b5e836bbd827e7a68a27aa551f3
3
+ metadata.gz: d20c3811d37360e2c0da2176c227b7328f3e4f329fd36c1e91c723e28b3946d9
4
+ data.tar.gz: d13fbd83f731ddcb162ac9776af0261971bba3d0dac4887d7088c4f1b788c110
5
5
  SHA512:
6
- metadata.gz: 8fdccdc91f67a3c97a1a25a517479195d3888d0595212e99097b7f40d4d43a8222235fa1ec180643f6a8345472584a3fc6d2d5e0adac098ba74a5ac7fff89adb
7
- data.tar.gz: 9395f4c989e12f492be1e841592e3239c4b1916b6b4db78033aa09d79126a5edbb5e4fd6198689984958db909d68dea993af297ca1f1d9fe893b41f7aeaf7949
6
+ metadata.gz: 7780c42117a2b9e6601f18a9480c0368cf33f4e7723091970dd28817affe727de3540d19c849daa56c1e3c65e0e9d8d4703e9765a73b0344cbc9263be37eae2a
7
+ data.tar.gz: 5aa121079dc94441e0bd876b7090ceac961a6a84c6264f73d8f65bd1242ff1182b2796d2b7dc0c2dc0b727159e10155c85c969b095df8cc101bab088a416d194
data/README.md CHANGED
@@ -498,7 +498,7 @@ Mailjet::ContactPii.delete(contact_ID)
498
498
 
499
499
  You can setup your Rack application in order to receive feedback on emails you sent (clicks, etc.)
500
500
 
501
- First notify Mailjet of your desired endpoint (say: 'http://www.my_domain.com/mailjet/callback') at https://www.mailjet.com/account/triggers
501
+ First notify Mailjet of your desired endpoint (say: 'http://www.my_domain.com/mailjet/callback') at https://app.mailjet.com/account/triggers
502
502
 
503
503
  Then configure Mailjet's Rack application to catch these callbacks.
504
504
 
@@ -80,13 +80,14 @@ module Mailjet
80
80
  end
81
81
 
82
82
  def handle_exception(e, additional_headers, payload = {})
83
- return e.response_body if e.response_headers[:content_type].include?("text/plain")
83
+ response_content_type = e.response_headers&.[](:content_type) || ''
84
+ return e.response_body if response_content_type.include?("text/plain")
84
85
 
85
86
  params = additional_headers[:params] || {}
86
87
  formatted_payload = (additional_headers[:content_type] == :json) ? Yajl::Parser.parse(payload) : payload
87
88
  params = params.merge!(formatted_payload) if formatted_payload.is_a?(Hash)
88
89
 
89
- response_body = if e.response_headers[:content_type].include?("application/json")
90
+ response_body = if response_content_type.include?("application/json")
90
91
  e.response_body
91
92
  else
92
93
  "{}"
@@ -55,7 +55,11 @@ module Mailjet
55
55
  end
56
56
 
57
57
  api_message = begin
58
- Yajl::Parser.parse(response.response_body)['ErrorMessage']
58
+ if response.response_body.present?
59
+ Yajl::Parser.parse(response.response_body)['ErrorMessage']
60
+ else
61
+ 'Unauthorized'
62
+ end
59
63
  rescue Yajl::ParseError
60
64
  response.response_body
61
65
  rescue NoMethodError
@@ -3,6 +3,7 @@ require 'yajl'
3
3
  require 'active_support'
4
4
  require 'active_support/core_ext/string'
5
5
  require 'active_support/core_ext/hash/indifferent_access'
6
+ require 'active_support/core_ext/object/blank'
6
7
 
7
8
 
8
9
 
@@ -284,7 +285,7 @@ module Mailjet
284
285
  if opts[:perform_api_call] && !persisted?
285
286
  # get attributes only for entity creation
286
287
  self.attributes = if self.resource_path == 'send'
287
- Yajl::Parser.parse(response.body)
288
+ response.respond_to?(:body) ? Yajl::Parser.parse(response.body) : Yajl::Parser.parse(response)
288
289
  else
289
290
  parse_api_json(response.body).first
290
291
  end
@@ -1,3 +1,3 @@
1
1
  module Mailjet
2
- VERSION = "1.8.1"
2
+ VERSION = "1.8.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailjet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Nappy
@@ -10,7 +10,7 @@ authors:
10
10
  - Benoit Bénézech
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-06-29 00:00:00.000000000 Z
13
+ date: 1980-01-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0'
307
307
  requirements: []
308
- rubygems_version: 3.6.2
308
+ rubygems_version: 3.6.9
309
309
  specification_version: 4
310
310
  summary: Mailjet a powerful all-in-one email service provider clients can use to get
311
311
  maximum insight and deliverability results from both their marketing and transactional