sendgrid-actionmailer 3.0.2 → 3.1.0

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: 776fb071876f8748d9d6ab2ae7d304b18d60023afb9e6747aa9b2e5c11757dbb
4
- data.tar.gz: 2ac9f378ca1372c581f10d24d1861a6b6b7fe3cbaddd9c5b6fc53f3d4f441ec8
3
+ metadata.gz: 65e252ac43443369106264d0b1b33c111184aede536c0b753798e91cd7c55e22
4
+ data.tar.gz: df787ee4c8c4c40b3a8ceeffb89fae8c162360a84960cb094e04dff096990250
5
5
  SHA512:
6
- metadata.gz: fb8c6ed35b214301a578d48b6d241c0a85366ff33767283da5e8d09c33210d960b62477c0de1df8397f144d0e70a95e83ea73c473502a7aa0ed8e949babe1ba7
7
- data.tar.gz: 3830c481b115beffd21d53a4140d3a1d6de73ff4fe2952cbdafb63b3133b663a464d0075def2934b61112ab5a791d5c31796a86f1d2eeb25deb54ea3af3a1fdb
6
+ metadata.gz: 74792717f19a0ca85d4c450faf2936e318d0d1885ec922a9522b43ac1a1911aa791f5790d6331a56a0c43d7ec190fc1fdfbfdc0033fc52494755c5ea560b0257
7
+ data.tar.gz: 45f55ecee835b2f49cff9fc16fc8845dd499ef9195f7e39737da6e83abb61d537b19293172758a7f682b3f4ba9388639d4052da11aff75841a581d52aec9e9b0
@@ -1,6 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
+ - 2.7.1
4
5
  - 2.6.5
5
6
  - 2.5.7
6
7
  - 2.4.9
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.0 - 2020-8-03
4
+
5
+ ### Changes
6
+
7
+ - #81 Fix warnings with ruby 2.7
8
+ - #83 Allow string type mail.to
9
+ - #84 Content-ID values to fix inline attachments
10
+
3
11
  ## 3.0.2 - 2020-4-20
4
12
 
5
13
  ### Changes
@@ -16,7 +16,7 @@ module SendGridActionMailer
16
16
 
17
17
  attr_accessor :settings, :api_key
18
18
 
19
- def initialize(**params)
19
+ def initialize(params = {})
20
20
  self.settings = DEFAULTS.merge(params)
21
21
  end
22
22
 
@@ -135,7 +135,7 @@ module SendGridActionMailer
135
135
  a.disposition = disposition unless disposition.nil?
136
136
 
137
137
  has_content_id = part.header && part.has_content_id?
138
- a.content_id = part.header['content_id'].value if has_content_id
138
+ a.content_id = part.header['content_id'].field.content_id if has_content_id
139
139
  end
140
140
  end
141
141
 
@@ -185,7 +185,7 @@ module SendGridActionMailer
185
185
  sendgrid_mail.add_personalization(setup_personalization(mail, p))
186
186
  end
187
187
  end
188
- if (mail.to && mail.to.any?) || (mail.cc && mail.cc.any?) || (mail.bcc && mail.bcc.any?)
188
+ if (mail.to && !mail.to.empty?) || (mail.cc && !mail.cc.empty?) || (mail.bcc && !mail.bcc.empty?)
189
189
  personalization = setup_personalization(mail, {})
190
190
  to_emails(mail.to).each { |to| personalization.add_to(to) }
191
191
  to_emails(mail.cc).each { |cc| personalization.add_cc(cc) }
@@ -229,7 +229,7 @@ module SendGridActionMailer
229
229
  asm = asm.delete_if { |key, value|
230
230
  !key.to_s.match(/(group_id)|(groups_to_display)/) }
231
231
  if asm.keys.map(&:to_s).include?('group_id')
232
- sendgrid_mail.asm = ASM.new(self.class.transform_keys(asm, &:to_sym))
232
+ sendgrid_mail.asm = ASM.new(**self.class.transform_keys(asm, &:to_sym))
233
233
  end
234
234
  end
235
235
  if mail['ip_pool_name']
@@ -242,19 +242,19 @@ module SendGridActionMailer
242
242
  settings = mail['mail_settings'].unparsed_value || {}
243
243
  sendgrid_mail.mail_settings = MailSettings.new.tap do |m|
244
244
  if settings[:bcc]
245
- m.bcc = BccSettings.new(settings[:bcc])
245
+ m.bcc = BccSettings.new(**settings[:bcc])
246
246
  end
247
247
  if settings[:bypass_list_management]
248
- m.bypass_list_management = BypassListManagement.new(settings[:bypass_list_management])
248
+ m.bypass_list_management = BypassListManagement.new(**settings[:bypass_list_management])
249
249
  end
250
250
  if settings[:footer]
251
- m.footer = Footer.new(settings[:footer])
251
+ m.footer = Footer.new(**settings[:footer])
252
252
  end
253
253
  if settings[:sandbox_mode]
254
- m.sandbox_mode = SandBoxMode.new(settings[:sandbox_mode])
254
+ m.sandbox_mode = SandBoxMode.new(**settings[:sandbox_mode])
255
255
  end
256
256
  if settings[:spam_check]
257
- m.spam_check = SpamCheck.new(settings[:spam_check])
257
+ m.spam_check = SpamCheck.new(**settings[:spam_check])
258
258
  end
259
259
  end
260
260
  end
@@ -265,16 +265,16 @@ module SendGridActionMailer
265
265
  settings = mail['tracking_settings'].unparsed_value
266
266
  sendgrid_mail.tracking_settings = TrackingSettings.new.tap do |t|
267
267
  if settings[:click_tracking]
268
- t.click_tracking = ClickTracking.new(settings[:click_tracking])
268
+ t.click_tracking = ClickTracking.new(**settings[:click_tracking])
269
269
  end
270
270
  if settings[:open_tracking]
271
- t.open_tracking = OpenTracking.new(settings[:open_tracking])
271
+ t.open_tracking = OpenTracking.new(**settings[:open_tracking])
272
272
  end
273
273
  if settings[:subscription_tracking]
274
- t.subscription_tracking = SubscriptionTracking.new(settings[:subscription_tracking])
274
+ t.subscription_tracking = SubscriptionTracking.new(**settings[:subscription_tracking])
275
275
  end
276
276
  if settings[:ganalytics]
277
- t.ganalytics = Ganalytics.new(settings[:ganalytics])
277
+ t.ganalytics = Ganalytics.new(**settings[:ganalytics])
278
278
  end
279
279
  end
280
280
  end
@@ -1,3 +1,3 @@
1
1
  module SendGridActionMailer
2
- VERSION = '3.0.2'.freeze
2
+ VERSION = '3.1.0'.freeze
3
3
  end
@@ -554,6 +554,9 @@ module SendGridActionMailer
554
554
  expect(content['filename']).to eq('specs.rb')
555
555
  expect(content['type']).to eq('application/x-ruby')
556
556
  expect(content['content_id'].class).to eq(String)
557
+ expect(content['content_id']).to include("@")
558
+ expect(content['content_id']).not_to include("<")
559
+ expect(content['content_id']).not_to include(">")
557
560
  end
558
561
  end
559
562
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid-actionmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eddie Zaneski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-20 00:00:00.000000000 Z
13
+ date: 2020-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mail