resend 0.17.1 → 0.17.2

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: 6a332acce7880b6cbf53de706ef39df76d4823b588b1577a6642105ca00f3649
4
- data.tar.gz: 5fdc46d025cb2377502e6f9a5a9a4ba605f279616f36dc7e537bb79d6f0c0413
3
+ metadata.gz: af2645da5d602105cd60b47747972b1fa8de2d24623a8b2632f3d218f91842ca
4
+ data.tar.gz: 1b903aab1f8868d1b29611e71a02f4a081f0921690b8d5091f0463fb631a6b21
5
5
  SHA512:
6
- metadata.gz: 1b3bbdc8c899628541a77cecb10d679afe0ca31f18bb80ad8eabedfbcdf3d7851153515387084cd003e54500fc7fa1b07f6f50a9c8a9eb9bd0d122df2199d73d
7
- data.tar.gz: 123206e9012019d7d1274b97daeb83f5f093234ae6f0b44f6f888ed89a17d2b03d8dce234b0b811ae9e8fb6568ef1f0712d0ccc3385278a929fa09b53974916e
6
+ metadata.gz: dc0183b4adc0123f612f41df6dd71a0a9e8faebae93feb82beb4a6545a8b3866acc578078d70c49157397215e1c40d4dfc480f5639e2101ae600972aa2012024
7
+ data.tar.gz: 669e1db9676210717c02f7508a7f0f67fbe225f2fec238827b53903ddb8117c7f6b41a92bc64681fb1c955ee128bcbc348233f703ca950507454f1df86858562
data/lib/resend/mailer.rb CHANGED
@@ -92,6 +92,11 @@ module Resend
92
92
  params
93
93
  end
94
94
 
95
+ # Remove nils from header values
96
+ def cleanup_headers(headers)
97
+ headers.delete_if { |_k, v| v.nil? }
98
+ end
99
+
95
100
  # Gets the values of the headers that are set through the `#mail` method
96
101
  #
97
102
  # @param Mail mail Rails Mail object
@@ -101,6 +106,7 @@ module Resend
101
106
  mail[:headers].unparsed_value.each do |k, v|
102
107
  params[k.to_s] = v
103
108
  end
109
+ cleanup_headers(params)
104
110
  params
105
111
  end
106
112
 
@@ -113,8 +119,7 @@ module Resend
113
119
  unignored_headers(mail).each do |h|
114
120
  params[h.name.to_s] = h.unparsed_value
115
121
  end
116
- # remove nil header values
117
- params.delete_if { |_k, v| v.nil? }
122
+ cleanup_headers(params)
118
123
  params
119
124
  end
120
125
 
@@ -35,6 +35,7 @@ module Resend
35
35
  }
36
36
 
37
37
  options[:body] = @body.to_json unless @body.empty?
38
+
38
39
  resp = HTTParty.send(@verb.to_sym, "#{BASE_URL}#{@path}", options)
39
40
 
40
41
  check_json!(resp)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resend
4
- VERSION = "0.17.1"
4
+ VERSION = "0.17.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derich Pacheco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty