sendgrid-actionmailer 2.2.0 → 2.2.1

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
  SHA1:
3
- metadata.gz: d0cf44faa71a46698dd397f001b0ed5c07f00edc
4
- data.tar.gz: 1feedab0fd41d4d9dbff84441f272bab024bf08d
3
+ metadata.gz: ff377937e071ce7e6dc1b86856cead94d05227e7
4
+ data.tar.gz: 75b9942067f8f1595a95492e77de8054de538a60
5
5
  SHA512:
6
- metadata.gz: 603221943d0dd4cc9446e68f3c77441930efa6f90545e7255e4af56eed0ab7fcf81e66d94ba6fbc72c9f8347db0922f54558ecb9ec6ea1f39ddb0a042520af51
7
- data.tar.gz: 2976d343386bb783ed92088d6a3417175ed61441562661d71dac703298bf093e6122b84f6509f2bb010b07cbee4a474067e35e8cb19691cb0cff29e4beb2b602
6
+ metadata.gz: f1f7897cee79c83ff6f8a437a42423fa1ed37f9ba2e95fb5d03fd56fe8b53f1e9dd6f89bf32cefef9285b8fd045e6805db52e75329dc2bff8719ea48ef4c4f4f
7
+ data.tar.gz: 83e7ff0e02f48d625e0cee94950e9bad79846a4bc85a16846df7298f37214823a937f3ff0075f889e4d58b4b7b87e906bdf1480cdd73acd580a3c18f930f0f0c
data/.travis.yml CHANGED
@@ -5,8 +5,8 @@ rvm:
5
5
  - 2.4.4
6
6
  - 2.3.4
7
7
  - 2.3.7
8
- - 2.2.10
9
8
  before_install:
9
+ - gem update --system
10
10
  - gem install bundler
11
11
  gemfile:
12
12
  - gemfiles/mail_2.5.gemfile
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 and content (either text or html), you do not need to specify those at the personalizations nor message level.
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.
@@ -1,3 +1,3 @@
1
1
  module SendGridActionMailer
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
@@ -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', '~> 1.6'
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.0
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: 2018-11-23 00:00:00.000000000 Z
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: '1.6'
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: '1.6'
70
+ version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rake
73
73
  requirement: !ruby/object:Gem::Requirement