sendgrid-actionmailer 2.2.0 → 2.2.1
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 -1
- data/README.md +2 -2
- data/lib/sendgrid_actionmailer/version.rb +1 -1
- data/lib/sendgrid_actionmailer.rb +1 -1
- data/sendgrid-actionmailer.gemspec +1 -1
- data/spec/lib/sendgrid_actionmailer_spec.rb +12 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff377937e071ce7e6dc1b86856cead94d05227e7
|
4
|
+
data.tar.gz: 75b9942067f8f1595a95492e77de8054de538a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1f7897cee79c83ff6f8a437a42423fa1ed37f9ba2e95fb5d03fd56fe8b53f1e9dd6f89bf32cefef9285b8fd045e6805db52e75329dc2bff8719ea48ef4c4f4f
|
7
|
+
data.tar.gz: 83e7ff0e02f48d625e0cee94950e9bad79846a4bc85a16846df7298f37214823a937f3ff0075f889e4d58b4b7b87e906bdf1480cdd73acd580a3c18f930f0f0c
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -45,7 +45,7 @@ The Mail functionality is extended to include additional attributes provided by
|
|
45
45
|
[Sendgrid v3 API Documentation](https://sendgrid.com/docs/API_Reference/api_v3.html)
|
46
46
|
|
47
47
|
### template_id (string)
|
48
|
-
The id of a template that you would like to use. If you use a template that contains a subject
|
48
|
+
The id of a template that you would like to use. If you use a template that contains a subject, you do not need to specify a subject at the personalizations nor message level. However, because of the way ActionMailer works, a body is required, even if the template contains one. If all your emails use templates with a body, you can add `default body: "not used"` to the top of your mailer.
|
49
49
|
|
50
50
|
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', template_id: 'template_1')```
|
51
51
|
|
@@ -229,4 +229,4 @@ Sendgrid unfortunately uses <% %> for their default substitution syntax, which m
|
|
229
229
|
* `<a href="%asm_global_unsubscribe_raw_url%">Unsubscribe from List</a>`
|
230
230
|
* `<a href="%asm_preferences_raw_url%">Manage Email Preferences</a>`
|
231
231
|
|
232
|
-
Note: This feature, and substitutions in general, do not work in combination with dynamic templates.
|
232
|
+
Note: This feature, and substitutions in general, do not work in combination with dynamic templates.
|
@@ -136,7 +136,7 @@ module SendGridActionMailer
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def json_parse(text, symbolize=true)
|
139
|
-
JSON.parse(text.gsub(/:*\"*([\%a-zA-Z0-9_-]*)\"*(( *)=>\ *)/) { "\"#{$1}\":" }, symbolize_names: symbolize)
|
139
|
+
JSON.parse(text.empty? ? '{}' : text.gsub(/:*\"*([\%a-zA-Z0-9_-]*)\"*(( *)=>\ *)/) { "\"#{$1}\":" }, symbolize_names: symbolize)
|
140
140
|
end
|
141
141
|
|
142
142
|
def add_send_options(sendgrid_mail, mail)
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'sendgrid-ruby', '~> 5.3.0'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'appraisal', '~> 2.1.0'
|
26
|
-
spec.add_development_dependency 'bundler'
|
26
|
+
spec.add_development_dependency 'bundler'
|
27
27
|
spec.add_development_dependency 'rake'
|
28
28
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
29
29
|
spec.add_development_dependency 'webmock'
|
@@ -393,6 +393,18 @@ module SendGridActionMailer
|
|
393
393
|
expect(client.sent_mail['personalizations'].first['dynamic_template_data']).to eq(template_data)
|
394
394
|
end
|
395
395
|
end
|
396
|
+
|
397
|
+
it 'sets dynamic template data and sandbox_mode' do
|
398
|
+
mail['mail_settings'] = '{}'
|
399
|
+
mailer.deliver!(mail)
|
400
|
+
expect(client.sent_mail['mail_settings']).to eq(nil)
|
401
|
+
end
|
402
|
+
|
403
|
+
it 'sets dynamic template data and sandbox_mode' do
|
404
|
+
mail['mail_settings'] = {}
|
405
|
+
mailer.deliver!(mail)
|
406
|
+
expect(client.sent_mail['mail_settings']).to eq(nil)
|
407
|
+
end
|
396
408
|
end
|
397
409
|
|
398
410
|
context 'multipart/alternative' do
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
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:
|
13
|
+
date: 2019-01-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mail
|
@@ -58,16 +58,16 @@ dependencies:
|
|
58
58
|
name: bundler
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
63
|
+
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - "
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
70
|
+
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rake
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|