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 +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +8 -0
- data/lib/sendgrid_actionmailer.rb +13 -13
- data/lib/sendgrid_actionmailer/version.rb +1 -1
- data/spec/lib/sendgrid_actionmailer_spec.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65e252ac43443369106264d0b1b33c111184aede536c0b753798e91cd7c55e22
|
4
|
+
data.tar.gz: df787ee4c8c4c40b3a8ceeffb89fae8c162360a84960cb094e04dff096990250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74792717f19a0ca85d4c450faf2936e318d0d1885ec922a9522b43ac1a1911aa791f5790d6331a56a0c43d7ec190fc1fdfbfdc0033fc52494755c5ea560b0257
|
7
|
+
data.tar.gz: 45f55ecee835b2f49cff9fc16fc8845dd499ef9195f7e39737da6e83abb61d537b19293172758a7f682b3f4ba9388639d4052da11aff75841a581d52aec9e9b0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -16,7 +16,7 @@ module SendGridActionMailer
|
|
16
16
|
|
17
17
|
attr_accessor :settings, :api_key
|
18
18
|
|
19
|
-
def initialize(
|
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'].
|
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.
|
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
|
@@ -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
|
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-
|
13
|
+
date: 2020-08-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mail
|