sendgrid-actionmailer 2.6.0 → 3.1.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 -2
- data/Appraisals +0 -8
- data/CHANGELOG.md +61 -0
- data/README.md +41 -23
- data/lib/sendgrid_actionmailer.rb +67 -51
- data/lib/sendgrid_actionmailer/version.rb +1 -1
- data/sendgrid-actionmailer.gemspec +1 -1
- data/spec/lib/sendgrid_actionmailer_spec.rb +116 -73
- metadata +7 -9
- data/gemfiles/mail_2.5.gemfile +0 -7
- data/gemfiles/mail_2.6.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68926bb0db0f0f622282b8429b3df0f86911ca0d72c0146bcaf181966130e290
|
4
|
+
data.tar.gz: '048ca01e72420c6f88be723ada69126d31c831f300b0aa539f8f7d236e3c500f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5999a6b88c2eb27869872a42c0f7300198cb9870f20087a9c38c68909b0bdcd6a960d0adc2eb01dfa39c530ff6eabee727e0ad9762b19294d57be8fd26e598f0
|
7
|
+
data.tar.gz: a26c201d0a9466684796371b82d2cb3d2aaad48efd1fc6a5c1ffd22b410bcdb71203379c498c8ae504653d0a2692206003ac3176ecfd32025e555fb38ebc0d2e
|
data/.travis.yml
CHANGED
@@ -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
|
@@ -9,6 +10,4 @@ before_install:
|
|
9
10
|
- gem update --system
|
10
11
|
- gem install bundler
|
11
12
|
gemfile:
|
12
|
-
- gemfiles/mail_2.5.gemfile
|
13
|
-
- gemfiles/mail_2.6.gemfile
|
14
13
|
- gemfiles/mail_2.7.gemfile
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,66 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 3.1.1 - 2020-11-06
|
4
|
+
- #92 globally configured mail_settings
|
5
|
+
- #95 add_mail_settings - support global settings
|
6
|
+
|
7
|
+
## 3.1.0 - 2020-8-03
|
8
|
+
|
9
|
+
### Changes
|
10
|
+
|
11
|
+
- #81 Fix warnings with ruby 2.7
|
12
|
+
- #83 Allow string type mail.to
|
13
|
+
- #84 Content-ID values to fix inline attachments
|
14
|
+
|
15
|
+
## 3.0.2 - 2020-4-20
|
16
|
+
|
17
|
+
### Changes
|
18
|
+
|
19
|
+
- perform_send_request setting for testing perposes
|
20
|
+
|
21
|
+
## 3.0.1 - 2020-4-3
|
22
|
+
|
23
|
+
### Changes
|
24
|
+
|
25
|
+
- Validate error response body for empty string
|
26
|
+
|
27
|
+
## 3.0.0 - 2020-3-2
|
28
|
+
|
29
|
+
### Removed
|
30
|
+
|
31
|
+
- Compatibility with mail gems before version 2.7
|
32
|
+
|
33
|
+
## 2.6.0 - 2020-1-23
|
34
|
+
|
35
|
+
### Changes
|
36
|
+
|
37
|
+
- Dont send content types with dynamic templates (#69)
|
38
|
+
|
39
|
+
## 2.5.0 - 2020-1-21
|
40
|
+
|
41
|
+
### Changes
|
42
|
+
|
43
|
+
- Add personalizations field (#60)
|
44
|
+
|
45
|
+
### Fixes
|
46
|
+
|
47
|
+
- Revert "Lazy load ActionMailer::Base" (#64)
|
48
|
+
- Yank 2.4.1
|
49
|
+
|
50
|
+
## 2.4.2 - 2020-1-21
|
51
|
+
|
52
|
+
### Fixes
|
53
|
+
|
54
|
+
- Revert "Lazy load ActionMailer::Base" (#64)
|
55
|
+
- Yank 2.4.1
|
56
|
+
|
57
|
+
## 2.4.1 - 2020-1-20
|
58
|
+
|
59
|
+
### Changed
|
60
|
+
|
61
|
+
- Update Travis CI settings to test on latest Ruby and mail gem version (#55)
|
62
|
+
- Lazy load ActionMailer::Base (#57)
|
63
|
+
|
3
64
|
## 2.4.0 - 2019-07-9
|
4
65
|
|
5
66
|
### Changed
|
data/README.md
CHANGED
@@ -24,6 +24,18 @@ Normal ActionMailer usage will now transparently be sent using SendGrid's Web AP
|
|
24
24
|
|
25
25
|
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body')```
|
26
26
|
|
27
|
+
### Mail Settings
|
28
|
+
|
29
|
+
Mail settings, such as sandbox_mode, may be applied globally through the sendgrid_actionmailer_settings configuration.
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
config.action_mailer.delivery_method = :sendgrid_actionmailer
|
33
|
+
config.action_mailer.sendgrid_actionmailer_settings = {
|
34
|
+
api_key: ENV['SENDGRID_API_KEY'],
|
35
|
+
mail_settings: { sandbox_mode: { enable: true }}
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
27
39
|
### Dynamic API Key
|
28
40
|
|
29
41
|
If you need to send mail for a number of Sendgrid accounts, you can set the API key for these as follows:
|
@@ -31,11 +43,12 @@ If you need to send mail for a number of Sendgrid accounts, you can set the API
|
|
31
43
|
|
32
44
|
```ruby
|
33
45
|
mail(to: 'example@email.com',
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
46
|
+
subject: 'email subject',
|
47
|
+
body: 'email body',
|
48
|
+
delivery_method_options: {
|
49
|
+
api_key: 'SENDGRID_API_KEY'
|
50
|
+
}
|
51
|
+
)
|
39
52
|
```
|
40
53
|
|
41
54
|
## SendGrid Mail Extensions
|
@@ -86,7 +99,7 @@ The unsubscribe group to associate with this email.
|
|
86
99
|
#### groups_to_display (array[integer])
|
87
100
|
An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.
|
88
101
|
|
89
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', asm: group_id: 99, groups_to_display: [4,5,6,7,8])```
|
102
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', asm: { group_id: 99, groups_to_display: [4,5,6,7,8] })```
|
90
103
|
|
91
104
|
### ip_pool_name (string)
|
92
105
|
The IP Pool that you would like to send this email from.
|
@@ -105,7 +118,7 @@ Indicates if this setting is enabled.
|
|
105
118
|
##### email (string)
|
106
119
|
The email address that you would like to receive the BCC.
|
107
120
|
|
108
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: {bcc: {enable: true, email: 'bcc@example.com}})```
|
121
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { bcc: { enable: true, email: 'bcc@example.com }})```
|
109
122
|
|
110
123
|
#### bypass_list_management (object)
|
111
124
|
Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email.
|
@@ -113,7 +126,7 @@ Allows you to bypass all unsubscribe groups and suppressions to ensure that the
|
|
113
126
|
###### enable (boolean)
|
114
127
|
Indicates if this setting is enabled.
|
115
128
|
|
116
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
129
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { bypass_list_management: { enable: true }})```
|
117
130
|
|
118
131
|
#### footer (object)
|
119
132
|
The default footer that you would like included on every email.
|
@@ -127,7 +140,7 @@ The plain text content of your footer.
|
|
127
140
|
##### html (string)
|
128
141
|
The HTML content of your footer.
|
129
142
|
|
130
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
143
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { footer: { enable: true, text: 'FOOTER', html: '<h1>FOOTER</h1>' }})```
|
131
144
|
|
132
145
|
#### sandbox_mode (object)
|
133
146
|
This allows you to send a test email to ensure that your request body is valid and formatted correctly.
|
@@ -135,7 +148,7 @@ This allows you to send a test email to ensure that your request body is valid a
|
|
135
148
|
##### enable (boolean)
|
136
149
|
Indicates if this setting is enabled.
|
137
150
|
|
138
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
151
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { sandbox_mode: { enable: true }})```
|
139
152
|
|
140
153
|
#### spam_check (object)
|
141
154
|
This allows you to test the content of your email for spam.
|
@@ -149,7 +162,8 @@ The threshold used to determine if your content qualifies as spam on a scale fro
|
|
149
162
|
##### post_to_url (string)
|
150
163
|
An Inbound Parse URL that you would like a copy of your email along with the spam report to be sent to.
|
151
164
|
|
152
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
165
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { spam_check: { enable: true, threshold: 1, post_to_url: 'https://spamcatcher.sendgrid.com' }})```
|
166
|
+
|
153
167
|
### tracking_settings(json)
|
154
168
|
Settings to determine how you would like to track the metrics of how your recipients interact with your email.
|
155
169
|
|
@@ -159,10 +173,10 @@ Allows you to track whether a recipient clicked a link in your email.
|
|
159
173
|
##### enable (boolean)
|
160
174
|
Indicates if this setting is enabled.
|
161
175
|
|
162
|
-
#####
|
176
|
+
##### enable_text (boolean)
|
163
177
|
Indicates if this setting should be included in the text/plain portion of your email.
|
164
178
|
|
165
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
179
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', tracking_settings: { click_tracking: { enable: false, enable_text: false }})```
|
166
180
|
|
167
181
|
#### open_tracking (object)
|
168
182
|
Allows you to track whether the email was opened or not, but including a single pixel image in the body of the content. When the pixel is loaded, we can log that the email was opened.
|
@@ -173,7 +187,7 @@ Indicates if this setting is enabled.
|
|
173
187
|
##### substitution_tag (string)
|
174
188
|
Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel.
|
175
189
|
|
176
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
190
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', tracking_settings: { open_tracking: { enable: true, substitution_tag: 'Optional tag to replace with the open image in the body of the message' }})```
|
177
191
|
|
178
192
|
#### subscription_tracking (object)
|
179
193
|
Allows you to insert a subscription management link at the bottom of the text and html bodies of your email. If you would like to specify the location of the link within your email, you may use the substitution_tag.
|
@@ -190,7 +204,7 @@ HTML to be appended to the email, with the subscription tracking link. You may c
|
|
190
204
|
##### substitution_tag (string)
|
191
205
|
A tag that will be replaced with the unsubscribe URL. for example: [unsubscribe_url]. If this parameter is used, it will override both the text and html parameters. The URL of the link will be placed at the substitution tag’s location, with no additional formatting.
|
192
206
|
|
193
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
207
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', tracking_settings: { subscription_tracking: { enable: true, text: 'text to insert into the text/plain portion of the message', html: 'html to insert into the text/html portion of the message', substitution_tag: 'Optional tag to replace with the open image in the body of the message' }})```
|
194
208
|
|
195
209
|
#### ganalytics (object)
|
196
210
|
Allows you to enable tracking provided by Google Analytics.
|
@@ -213,13 +227,13 @@ Used to differentiate your campaign from advertisements.
|
|
213
227
|
##### utm_campaign (string)
|
214
228
|
The name of the campaign.
|
215
229
|
|
216
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
230
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', tracking_settings: { ganalytics: { enable: true, utm_source: 'some source', utm_medium: 'some medium', utm_term: 'some term', utm_content: 'some content', utm_campaign: 'some campaign' }})```
|
217
231
|
|
218
232
|
### dynamic_template_data (json)
|
219
233
|
|
220
|
-
Data to provide for feeding the new dynamic templates in Sendgrid with valueable data. This also disables the following Unsubscribe links because of deprecation of substitutions in the new template implementaiton.
|
234
|
+
Data to provide for feeding the new dynamic templates in Sendgrid with valueable data. This also disables the following Unsubscribe links because of deprecation of substitutions in the new template implementaiton. Variables are available within templates using [{{handlebar syntax}}](https://sendgrid.com/docs/for-developers/sending-email/using-handlebars).
|
221
235
|
|
222
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
236
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', dynamic_template_data: { variable_1: 'foo', variable_2: 'bar' })```
|
223
237
|
|
224
238
|
### personalizations (json)
|
225
239
|
|
@@ -246,19 +260,23 @@ Example usage:
|
|
246
260
|
|
247
261
|
```
|
248
262
|
mail(subject: 'default subject', 'email body', personalizations: [
|
249
|
-
{ to: { email: 'example@example.com' }},
|
250
|
-
{ to: { email: 'example2@example.com' }}
|
263
|
+
{ to: [{ email: 'example@example.com' }]},
|
264
|
+
{ to: [{ email: 'example2@example.com' }]}
|
251
265
|
])
|
252
|
-
|
253
266
|
```
|
254
267
|
|
255
|
-
|
256
268
|
### Unsubscribe Links
|
257
269
|
|
258
|
-
Sendgrid unfortunately uses <% %> for their default substitution syntax, which makes it incompatible with Rails templates. Their proposed solution is to use Personalization Substitutions with the v3 Mail Send Endpoint.
|
270
|
+
Sendgrid unfortunately uses <% %> for their default substitution syntax, which makes it incompatible with Rails templates. Their proposed solution is to use Personalization Substitutions with the v3 Mail Send Endpoint. This gem makes that modification to make the following Rails friendly unsubscribe urls.
|
259
271
|
|
260
272
|
* `<a href="%asm_group_unsubscribe_raw_url%">Unsubscribe</a>`
|
261
273
|
* `<a href="%asm_global_unsubscribe_raw_url%">Unsubscribe from List</a>`
|
262
274
|
* `<a href="%asm_preferences_raw_url%">Manage Email Preferences</a>`
|
263
275
|
|
264
276
|
Note: This feature, and substitutions in general, do not work in combination with dynamic templates.
|
277
|
+
|
278
|
+
## Testing
|
279
|
+
|
280
|
+
The setting `perform_send_request` is available to disable sending for testing purposes. Setting perform_send_request false and return_response true enables the testing of the JSON API payload.
|
281
|
+
|
282
|
+
|
@@ -4,6 +4,7 @@ require 'sendgrid-ruby'
|
|
4
4
|
|
5
5
|
module SendGridActionMailer
|
6
6
|
class DeliveryMethod
|
7
|
+
|
7
8
|
# TODO: use custom class to customer excpetion payload
|
8
9
|
SendgridDeliveryError = Class.new(StandardError)
|
9
10
|
|
@@ -15,7 +16,7 @@ module SendGridActionMailer
|
|
15
16
|
|
16
17
|
attr_accessor :settings, :api_key
|
17
18
|
|
18
|
-
def initialize(
|
19
|
+
def initialize(params = {})
|
19
20
|
self.settings = DEFAULTS.merge(params)
|
20
21
|
end
|
21
22
|
|
@@ -33,7 +34,11 @@ module SendGridActionMailer
|
|
33
34
|
add_mail_settings(sendgrid_mail, mail)
|
34
35
|
add_tracking_settings(sendgrid_mail, mail)
|
35
36
|
|
36
|
-
|
37
|
+
if (settings[:perform_send_request] == false)
|
38
|
+
response = sendgrid_mail
|
39
|
+
else
|
40
|
+
response = perform_send_request(sendgrid_mail)
|
41
|
+
end
|
37
42
|
|
38
43
|
settings[:return_response] ? response : self
|
39
44
|
end
|
@@ -74,48 +79,50 @@ module SendGridActionMailer
|
|
74
79
|
end
|
75
80
|
|
76
81
|
def setup_personalization(mail, personalization_hash)
|
77
|
-
|
82
|
+
personalization = Personalization.new
|
83
|
+
|
84
|
+
personalization_hash = self.class.transform_keys(personalization_hash, &:to_s)
|
78
85
|
|
79
86
|
(personalization_hash['to'] || []).each do |to|
|
80
|
-
|
87
|
+
personalization.add_to Email.new(email: to['email'], name: to['name'])
|
81
88
|
end
|
82
89
|
(personalization_hash['cc'] || []).each do |cc|
|
83
|
-
|
90
|
+
personalization.add_cc Email.new(email: cc['email'], name: cc['name'])
|
84
91
|
end
|
85
92
|
(personalization_hash['bcc'] || []).each do |bcc|
|
86
|
-
|
93
|
+
personalization.add_bcc Email.new(email: bcc['email'], name: bcc['name'])
|
87
94
|
end
|
88
95
|
(personalization_hash['headers'] || []).each do |header_key, header_value|
|
89
|
-
|
96
|
+
personalization.add_header Header.new(key: header_key, value: header_value)
|
90
97
|
end
|
91
98
|
(personalization_hash['substitutions'] || {}).each do |sub_key, sub_value|
|
92
|
-
|
99
|
+
personalization.add_substitution(Substitution.new(key: sub_key, value: sub_value))
|
93
100
|
end
|
94
101
|
(personalization_hash['custom_args'] || {}).each do |arg_key, arg_value|
|
95
|
-
|
102
|
+
personalization.add_custom_arg(CustomArg.new(key: arg_key, value: arg_value))
|
96
103
|
end
|
97
104
|
if personalization_hash['send_at']
|
98
|
-
|
105
|
+
personalization.send_at = personalization_hash['send_at']
|
99
106
|
end
|
100
107
|
if personalization_hash['subject']
|
101
|
-
|
108
|
+
personalization.subject = personalization_hash['subject']
|
102
109
|
end
|
103
110
|
|
104
111
|
if mail['dynamic_template_data'] || personalization_hash['dynamic_template_data']
|
105
112
|
if mail['dynamic_template_data']
|
106
|
-
data =
|
113
|
+
data = mail['dynamic_template_data'].unparsed_value
|
107
114
|
data.merge!(personalization_hash['dynamic_template_data'] || {})
|
108
115
|
else
|
109
116
|
data = personalization_hash['dynamic_template_data']
|
110
117
|
end
|
111
|
-
|
118
|
+
personalization.add_dynamic_template_data(data)
|
112
119
|
elsif mail['template_id'].nil?
|
113
|
-
|
114
|
-
|
115
|
-
|
120
|
+
personalization.add_substitution(Substitution.new(key: "%asm_group_unsubscribe_raw_url%", value: "<%asm_group_unsubscribe_raw_url%>"))
|
121
|
+
personalization.add_substitution(Substitution.new(key: "%asm_global_unsubscribe_raw_url%", value: "<%asm_global_unsubscribe_raw_url%>"))
|
122
|
+
personalization.add_substitution(Substitution.new(key: "%asm_preferences_raw_url%", value: "<%asm_preferences_raw_url%>"))
|
116
123
|
end
|
117
124
|
|
118
|
-
|
125
|
+
return personalization
|
119
126
|
end
|
120
127
|
|
121
128
|
def to_attachment(part)
|
@@ -128,7 +135,7 @@ module SendGridActionMailer
|
|
128
135
|
a.disposition = disposition unless disposition.nil?
|
129
136
|
|
130
137
|
has_content_id = part.header && part.has_content_id?
|
131
|
-
a.content_id = part.header['content_id'].
|
138
|
+
a.content_id = part.header['content_id'].field.content_id if has_content_id
|
132
139
|
end
|
133
140
|
end
|
134
141
|
|
@@ -142,7 +149,7 @@ module SendGridActionMailer
|
|
142
149
|
def add_api_key(sendgrid_mail, mail)
|
143
150
|
self.api_key = settings.fetch(:api_key)
|
144
151
|
if mail['delivery-method-options'] && mail['delivery-method-options'].value.include?('api_key')
|
145
|
-
self.api_key =
|
152
|
+
self.api_key = mail['delivery-method-options'].unparsed_value['api_key']
|
146
153
|
end
|
147
154
|
end
|
148
155
|
|
@@ -172,25 +179,19 @@ module SendGridActionMailer
|
|
172
179
|
end
|
173
180
|
end
|
174
181
|
|
175
|
-
def json_parse(text, symbolize=true)
|
176
|
-
JSON.parse(text.empty? ? '{}' : text.gsub(/:*\"*([\%a-zA-Z0-9_-]*)\"*(( *)=>\ *)/) { "\"#{$1}\":" }, symbolize_names: symbolize)
|
177
|
-
end
|
178
|
-
|
179
182
|
def add_personalizations(sendgrid_mail, mail)
|
180
|
-
if
|
183
|
+
if mail['personalizations']
|
184
|
+
mail['personalizations'].unparsed_value.each do |p|
|
185
|
+
sendgrid_mail.add_personalization(setup_personalization(mail, p))
|
186
|
+
end
|
187
|
+
end
|
188
|
+
if (mail.to && !mail.to.empty?) || (mail.cc && !mail.cc.empty?) || (mail.bcc && !mail.bcc.empty?)
|
181
189
|
personalization = setup_personalization(mail, {})
|
182
190
|
to_emails(mail.to).each { |to| personalization.add_to(to) }
|
183
191
|
to_emails(mail.cc).each { |cc| personalization.add_cc(cc) }
|
184
192
|
to_emails(mail.bcc).each { |bcc| personalization.add_bcc(bcc) }
|
185
193
|
sendgrid_mail.add_personalization(personalization)
|
186
194
|
end
|
187
|
-
|
188
|
-
if mail['personalizations']
|
189
|
-
personalizations = json_parse('[' + mail['personalizations'].value + ']', false)
|
190
|
-
personalizations.each do |p|
|
191
|
-
sendgrid_mail.add_personalization(setup_personalization(mail, p))
|
192
|
-
end
|
193
|
-
end
|
194
195
|
end
|
195
196
|
|
196
197
|
def add_send_options(sendgrid_mail, mail)
|
@@ -198,12 +199,12 @@ module SendGridActionMailer
|
|
198
199
|
sendgrid_mail.template_id = mail['template_id'].to_s
|
199
200
|
end
|
200
201
|
if mail['sections']
|
201
|
-
|
202
|
+
mail['sections'].unparsed_value.each do |key, value|
|
202
203
|
sendgrid_mail.add_section(Section.new(key: key, value: value))
|
203
204
|
end
|
204
205
|
end
|
205
206
|
if mail['headers']
|
206
|
-
|
207
|
+
mail['headers'].unparsed_value.each do |key, value|
|
207
208
|
sendgrid_mail.add_header(Header.new(key: key, value: value))
|
208
209
|
end
|
209
210
|
end
|
@@ -213,7 +214,7 @@ module SendGridActionMailer
|
|
213
214
|
end
|
214
215
|
end
|
215
216
|
if mail['custom_args']
|
216
|
-
|
217
|
+
mail['custom_args'].unparsed_value.each do |key, value|
|
217
218
|
sendgrid_mail.add_custom_arg(CustomArg.new(key: key, value: value))
|
218
219
|
end
|
219
220
|
end
|
@@ -224,10 +225,11 @@ module SendGridActionMailer
|
|
224
225
|
sendgrid_mail.batch_id = mail['batch_id'].to_s
|
225
226
|
end
|
226
227
|
if mail['asm']
|
227
|
-
asm =
|
228
|
-
asm = asm.delete_if { |key, value|
|
229
|
-
|
230
|
-
|
228
|
+
asm = mail['asm'].unparsed_value
|
229
|
+
asm = asm.delete_if { |key, value|
|
230
|
+
!key.to_s.match(/(group_id)|(groups_to_display)/) }
|
231
|
+
if asm.keys.map(&:to_s).include?('group_id')
|
232
|
+
sendgrid_mail.asm = ASM.new(**self.class.transform_keys(asm, &:to_sym))
|
231
233
|
end
|
232
234
|
end
|
233
235
|
if mail['ip_pool_name']
|
@@ -236,23 +238,25 @@ module SendGridActionMailer
|
|
236
238
|
end
|
237
239
|
|
238
240
|
def add_mail_settings(sendgrid_mail, mail)
|
239
|
-
|
240
|
-
|
241
|
+
local_settings = mail['mail_settings'] && mail['mail_settings'].unparsed_value || {}
|
242
|
+
global_settings = self.settings[:mail_settings] || {}
|
243
|
+
settings = global_settings.merge(local_settings)
|
244
|
+
unless settings.empty?
|
241
245
|
sendgrid_mail.mail_settings = MailSettings.new.tap do |m|
|
242
246
|
if settings[:bcc]
|
243
|
-
m.bcc = BccSettings.new(settings[:bcc])
|
247
|
+
m.bcc = BccSettings.new(**settings[:bcc])
|
244
248
|
end
|
245
249
|
if settings[:bypass_list_management]
|
246
|
-
m.bypass_list_management = BypassListManagement.new(settings[:bypass_list_management])
|
250
|
+
m.bypass_list_management = BypassListManagement.new(**settings[:bypass_list_management])
|
247
251
|
end
|
248
252
|
if settings[:footer]
|
249
|
-
m.footer = Footer.new(settings[:footer])
|
253
|
+
m.footer = Footer.new(**settings[:footer])
|
250
254
|
end
|
251
255
|
if settings[:sandbox_mode]
|
252
|
-
m.sandbox_mode = SandBoxMode.new(settings[:sandbox_mode])
|
256
|
+
m.sandbox_mode = SandBoxMode.new(**settings[:sandbox_mode])
|
253
257
|
end
|
254
258
|
if settings[:spam_check]
|
255
|
-
m.spam_check = SpamCheck.new(settings[:spam_check])
|
259
|
+
m.spam_check = SpamCheck.new(**settings[:spam_check])
|
256
260
|
end
|
257
261
|
end
|
258
262
|
end
|
@@ -260,19 +264,19 @@ module SendGridActionMailer
|
|
260
264
|
|
261
265
|
def add_tracking_settings(sendgrid_mail, mail)
|
262
266
|
if mail['tracking_settings']
|
263
|
-
settings =
|
267
|
+
settings = mail['tracking_settings'].unparsed_value
|
264
268
|
sendgrid_mail.tracking_settings = TrackingSettings.new.tap do |t|
|
265
269
|
if settings[:click_tracking]
|
266
|
-
t.click_tracking = ClickTracking.new(settings[:click_tracking])
|
270
|
+
t.click_tracking = ClickTracking.new(**settings[:click_tracking])
|
267
271
|
end
|
268
272
|
if settings[:open_tracking]
|
269
|
-
t.open_tracking = OpenTracking.new(settings[:open_tracking])
|
273
|
+
t.open_tracking = OpenTracking.new(**settings[:open_tracking])
|
270
274
|
end
|
271
275
|
if settings[:subscription_tracking]
|
272
|
-
t.subscription_tracking = SubscriptionTracking.new(settings[:subscription_tracking])
|
276
|
+
t.subscription_tracking = SubscriptionTracking.new(**settings[:subscription_tracking])
|
273
277
|
end
|
274
278
|
if settings[:ganalytics]
|
275
|
-
t.ganalytics = Ganalytics.new(settings[:ganalytics])
|
279
|
+
t.ganalytics = Ganalytics.new(**settings[:ganalytics])
|
276
280
|
end
|
277
281
|
end
|
278
282
|
end
|
@@ -282,7 +286,7 @@ module SendGridActionMailer
|
|
282
286
|
result = client.mail._('send').post(request_body: email.to_json) # ლ(ಠ益ಠლ) that API
|
283
287
|
|
284
288
|
if result.status_code && result.status_code.start_with?('4')
|
285
|
-
message =
|
289
|
+
message = !(result.body.empty?) ? JSON.parse(result.body).fetch('errors').pop.fetch('message') : 'Sendgrid API Error'
|
286
290
|
full_message = "Sendgrid delivery failed with #{result.status_code} #{message}"
|
287
291
|
|
288
292
|
settings[:raise_delivery_errors] ? raise(SendgridDeliveryError, full_message) : warn(full_message)
|
@@ -290,5 +294,17 @@ module SendGridActionMailer
|
|
290
294
|
|
291
295
|
result
|
292
296
|
end
|
297
|
+
|
298
|
+
# Recursive key transformation based on Rails deep_transform_values
|
299
|
+
def self.transform_keys(object, &block)
|
300
|
+
case object
|
301
|
+
when Hash
|
302
|
+
object.map { |key, value| [yield(key), transform_keys(value, &block)] }.to_h
|
303
|
+
when Array
|
304
|
+
object.map { |e| transform_keys(e, &block) }
|
305
|
+
else
|
306
|
+
object
|
307
|
+
end
|
308
|
+
end
|
293
309
|
end
|
294
310
|
end
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_dependency 'mail', '~> 2.
|
22
|
+
spec.add_dependency 'mail', '~> 2.7'
|
23
23
|
spec.add_dependency 'sendgrid-ruby', '~> 6.0'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'appraisal', '~> 2.1.0'
|
@@ -3,12 +3,8 @@ require 'webmock/rspec'
|
|
3
3
|
|
4
4
|
module SendGridActionMailer
|
5
5
|
describe DeliveryMethod do
|
6
|
-
def
|
7
|
-
|
8
|
-
hash.each_key do |key|
|
9
|
-
result[key.to_s] = hash[key]
|
10
|
-
end
|
11
|
-
result
|
6
|
+
def transform_keys(object, &block)
|
7
|
+
SendGridActionMailer::DeliveryMethod.transform_keys(object, &block)
|
12
8
|
end
|
13
9
|
|
14
10
|
subject(:mailer) do
|
@@ -63,6 +59,11 @@ module SendGridActionMailer
|
|
63
59
|
m = DeliveryMethod.new(return_response: true)
|
64
60
|
expect(m.settings[:return_response]).to eq(true)
|
65
61
|
end
|
62
|
+
|
63
|
+
it 'sets perform_deliveries' do
|
64
|
+
m = DeliveryMethod.new(perform_send_request: false)
|
65
|
+
expect(m.settings[:perform_send_request]).to eq(false)
|
66
|
+
end
|
66
67
|
end
|
67
68
|
|
68
69
|
describe '#deliver!' do
|
@@ -329,10 +330,10 @@ module SendGridActionMailer
|
|
329
330
|
end
|
330
331
|
|
331
332
|
it 'sets asm' do
|
332
|
-
asm = {
|
333
|
+
asm = {group_id: 99, groups_to_display: [4,5,6,7,8]}
|
333
334
|
mail['asm'] = asm
|
334
335
|
mailer.deliver!(mail)
|
335
|
-
expect(client.sent_mail['asm']).to eq(asm)
|
336
|
+
expect(client.sent_mail['asm']).to eq(transform_keys(asm, &:to_s))
|
336
337
|
end
|
337
338
|
|
338
339
|
it 'sets ip_pool_name' do
|
@@ -341,93 +342,77 @@ module SendGridActionMailer
|
|
341
342
|
expect(client.sent_mail['ip_pool_name']).to eq('marketing')
|
342
343
|
end
|
343
344
|
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
expect(client.sent_mail['asm']).to eq({"group_id" => 99, "groups_to_display" => [4,5,6,7,8]})
|
350
|
-
end
|
351
|
-
|
352
|
-
it "should parse 1.9 hash" do
|
353
|
-
asm = { group_id: 99, groups_to_display: [4,5,6,7,8]}
|
354
|
-
mail['asm'] = asm
|
355
|
-
mailer.deliver!(mail)
|
356
|
-
expect(client.sent_mail['asm']).to eq({"group_id" => 99, "groups_to_display" => [4,5,6,7,8]})
|
357
|
-
end
|
358
|
-
|
359
|
-
it "should parse json" do
|
360
|
-
asm = {'group_id' => 99, 'groups_to_display' => [4,5,6,7,8]}
|
361
|
-
mail['asm'] = asm.to_json
|
362
|
-
mailer.deliver!(mail)
|
363
|
-
expect(client.sent_mail['asm']).to eq({"group_id" => 99, "groups_to_display" => [4,5,6,7,8]})
|
364
|
-
end
|
345
|
+
it 'should not change values inside custom args' do
|
346
|
+
custom_args = { 'text' => 'line with a => in it' }
|
347
|
+
mail['custom_args'] = custom_args
|
348
|
+
mailer.deliver!(mail)
|
349
|
+
expect(client.sent_mail['custom_args']).to eq('text' => 'line with a => in it')
|
365
350
|
end
|
366
351
|
|
367
352
|
context 'mail_settings' do
|
368
353
|
it 'sets bcc' do
|
369
|
-
bcc = {
|
354
|
+
bcc = { bcc: { enable: true, email: 'test@example.com' }}
|
370
355
|
mail['mail_settings'] = bcc
|
371
356
|
mailer.deliver!(mail)
|
372
|
-
expect(client.sent_mail['mail_settings']).to eq(bcc)
|
357
|
+
expect(client.sent_mail['mail_settings']).to eq(transform_keys(bcc, &:to_s))
|
373
358
|
end
|
374
359
|
|
375
360
|
it 'sets bypass_list_management' do
|
376
|
-
bypass = {
|
361
|
+
bypass = { bypass_list_management: { enable: true }}
|
377
362
|
mail['mail_settings'] = bypass
|
378
363
|
mailer.deliver!(mail)
|
379
|
-
expect(client.sent_mail['mail_settings']).to eq(bypass)
|
364
|
+
expect(client.sent_mail['mail_settings']).to eq(transform_keys(bypass, &:to_s))
|
380
365
|
end
|
381
366
|
|
382
367
|
it 'sets footer' do
|
383
|
-
footer = {
|
368
|
+
footer = {footer: { enable: true, text: 'Footer Text', html: '<html><body>Footer Text</body></html>'}}
|
384
369
|
mail['mail_settings'] = footer
|
385
370
|
mailer.deliver!(mail)
|
386
|
-
expect(client.sent_mail['mail_settings']).to eq(footer)
|
371
|
+
expect(client.sent_mail['mail_settings']).to eq(transform_keys(footer, &:to_s))
|
387
372
|
end
|
388
373
|
|
389
374
|
it 'sets sandbox_mode' do
|
390
|
-
sandbox = {
|
375
|
+
sandbox = {sandbox_mode: { enable: true }}
|
391
376
|
mail['mail_settings'] = sandbox
|
392
377
|
mailer.deliver!(mail)
|
393
|
-
expect(client.sent_mail['mail_settings']).to eq(sandbox)
|
378
|
+
expect(client.sent_mail['mail_settings']).to eq(transform_keys(sandbox, &:to_s))
|
394
379
|
end
|
395
380
|
|
396
381
|
it 'sets spam_check' do
|
397
|
-
spam_check = {
|
382
|
+
spam_check = {spam_check: { enable: true, threshold: 1, post_to_url: 'https://spamcatcher.sendgrid.com'}}
|
398
383
|
mail['mail_settings'] = spam_check
|
399
384
|
mailer.deliver!(mail)
|
400
|
-
expect(client.sent_mail['mail_settings']).to eq(spam_check)
|
385
|
+
expect(client.sent_mail['mail_settings']).to eq(transform_keys(spam_check, &:to_s))
|
401
386
|
end
|
402
387
|
end
|
403
388
|
|
404
389
|
context 'tracking_settings' do
|
405
390
|
it 'sets click_tracking' do
|
406
|
-
tracking = {
|
407
|
-
mail['tracking_settings'] = tracking
|
391
|
+
tracking = { click_tracking: { enable: false, enable_text: false }}
|
392
|
+
mail['tracking_settings'] = tracking.dup
|
408
393
|
mailer.deliver!(mail)
|
409
|
-
expect(client.sent_mail['tracking_settings']).to eq(tracking)
|
394
|
+
expect(client.sent_mail['tracking_settings']).to eq(transform_keys(tracking, &:to_s))
|
410
395
|
end
|
411
396
|
|
412
397
|
it 'sets open_tracking' do
|
413
|
-
tracking = {
|
398
|
+
tracking = { open_tracking: { enable: true, substitution_tag: 'Optional tag to replace with the open image in the body of the message' }}
|
414
399
|
mail['tracking_settings'] = tracking
|
415
400
|
mailer.deliver!(mail)
|
416
|
-
expect(client.sent_mail['tracking_settings']).to eq(tracking)
|
401
|
+
expect(client.sent_mail['tracking_settings']).to eq(transform_keys(tracking, &:to_s))
|
417
402
|
end
|
418
403
|
|
419
404
|
it 'sets subscription_tracking' do
|
420
|
-
tracking = {
|
405
|
+
tracking = { subscription_tracking: { enable: true, text: 'text to insert into the text/plain portion of the message', html: 'html to insert into the text/html portion of the message', substitution_tag: 'Optional tag to replace with the open image in the body of the def message' }}
|
421
406
|
mail['tracking_settings'] = tracking
|
422
407
|
mailer.deliver!(mail)
|
423
|
-
expect(client.sent_mail['tracking_settings']).to eq(tracking)
|
408
|
+
expect(client.sent_mail['tracking_settings']).to eq(transform_keys(tracking, &:to_s))
|
424
409
|
end
|
425
410
|
|
426
411
|
it 'sets ganalytics' do
|
427
|
-
tracking = {
|
412
|
+
tracking = { ganalytics: { enable: true, utm_source: 'some source', utm_medium: 'some medium', utm_term: 'some term', utm_content: 'some content', utm_campaign: 'some campaign' }}
|
428
413
|
mail['tracking_settings'] = tracking
|
429
414
|
mailer.deliver!(mail)
|
430
|
-
expect(client.sent_mail['tracking_settings']).to eq(tracking)
|
415
|
+
expect(client.sent_mail['tracking_settings']).to eq(transform_keys(tracking, &:to_s))
|
431
416
|
end
|
432
417
|
end
|
433
418
|
|
@@ -440,19 +425,26 @@ module SendGridActionMailer
|
|
440
425
|
|
441
426
|
it 'sets dynamic_template_data' do
|
442
427
|
mailer.deliver!(mail)
|
443
|
-
expect(client.sent_mail['personalizations'].first['dynamic_template_data']).to eq(
|
428
|
+
expect(client.sent_mail['personalizations'].first['dynamic_template_data']).to eq(template_data)
|
444
429
|
end
|
445
430
|
|
446
431
|
it 'does not set unsubscribe substitutions' do
|
447
432
|
mailer.deliver!(mail)
|
448
433
|
expect(client.sent_mail['personalizations'].first).to_not have_key('substitutions')
|
449
434
|
end
|
450
|
-
end
|
451
435
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
436
|
+
context 'containing what looks like hash syntax' do
|
437
|
+
let(:template_data) do
|
438
|
+
{ hint: 'Just use => instead of :' }
|
439
|
+
end
|
440
|
+
|
441
|
+
it 'does not change values inside dynamic template data' do
|
442
|
+
mailer.deliver!(mail)
|
443
|
+
expect(
|
444
|
+
client.sent_mail['personalizations'].first['dynamic_template_data']
|
445
|
+
).to eq(template_data)
|
446
|
+
end
|
447
|
+
end
|
456
448
|
end
|
457
449
|
|
458
450
|
it 'sets dynamic template data and sandbox_mode' do
|
@@ -562,6 +554,9 @@ module SendGridActionMailer
|
|
562
554
|
expect(content['filename']).to eq('specs.rb')
|
563
555
|
expect(content['type']).to eq('application/x-ruby')
|
564
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(">")
|
565
560
|
end
|
566
561
|
end
|
567
562
|
|
@@ -670,20 +665,21 @@ module SendGridActionMailer
|
|
670
665
|
end
|
671
666
|
|
672
667
|
context 'with symbols used as keys' do
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
668
|
+
let(:personalizations) do
|
669
|
+
[
|
670
|
+
{
|
671
|
+
to: [
|
672
|
+
{email: 'sally1@example.com', name: 'Sally 1'},
|
673
|
+
{email: 'sally2@example.com', name: 'Sally 2'},
|
674
|
+
]
|
675
|
+
}
|
676
|
+
]
|
681
677
|
end
|
682
678
|
|
683
679
|
it 'still works' do
|
684
680
|
mailer.deliver!(mail)
|
685
681
|
expect(client.sent_mail['personalizations'].length).to eq(1)
|
686
|
-
expected_to = personalizations[0][:to].map { |t|
|
682
|
+
expected_to = personalizations[0][:to].map { |t| transform_keys(t, &:to_s) }
|
687
683
|
expect(client.sent_mail['personalizations'][0]['to']).to eq(expected_to)
|
688
684
|
end
|
689
685
|
end
|
@@ -717,7 +713,7 @@ module SendGridActionMailer
|
|
717
713
|
{ 'variable_3' => '1', 'variable_4' => '2' }
|
718
714
|
end
|
719
715
|
|
720
|
-
before { mail['dynamic_template_data'] = mail_template_data }
|
716
|
+
before { mail['dynamic_template_data'] = mail_template_data.dup }
|
721
717
|
|
722
718
|
it 'sets dynamic_template_data where not also provided as a personalization' do
|
723
719
|
mailer.deliver!(mail)
|
@@ -739,9 +735,9 @@ module SendGridActionMailer
|
|
739
735
|
it 'adds that to address as a separate personalization' do
|
740
736
|
mailer.deliver!(mail)
|
741
737
|
expect(client.sent_mail['personalizations'].length).to eq(3)
|
742
|
-
expect(client.sent_mail['personalizations'][0]['to']).to eq([
|
743
|
-
expect(client.sent_mail['personalizations'][1]['to']).to eq(personalizations[
|
744
|
-
expect(client.sent_mail['personalizations'][2]['to']).to eq(
|
738
|
+
expect(client.sent_mail['personalizations'][0]['to']).to eq(personalizations[0]['to'])
|
739
|
+
expect(client.sent_mail['personalizations'][1]['to']).to eq(personalizations[1]['to'])
|
740
|
+
expect(client.sent_mail['personalizations'][2]['to']).to eq([{"email"=>"test@sendgrid.com"}])
|
745
741
|
end
|
746
742
|
end
|
747
743
|
|
@@ -751,9 +747,9 @@ module SendGridActionMailer
|
|
751
747
|
it 'adds that cc address as a separate personalization' do
|
752
748
|
mailer.deliver!(mail)
|
753
749
|
expect(client.sent_mail['personalizations'].length).to eq(3)
|
754
|
-
expect(client.sent_mail['personalizations'][0]['cc']).to eq([
|
755
|
-
expect(client.sent_mail['personalizations'][1]['cc']).to eq(personalizations[
|
756
|
-
expect(client.sent_mail['personalizations'][2]['cc']).to eq(
|
750
|
+
expect(client.sent_mail['personalizations'][0]['cc']).to eq(personalizations[0]['cc'])
|
751
|
+
expect(client.sent_mail['personalizations'][1]['cc']).to eq(personalizations[1]['cc'])
|
752
|
+
expect(client.sent_mail['personalizations'][2]['cc']).to eq([{"email"=>"test@sendgrid.com"}])
|
757
753
|
end
|
758
754
|
end
|
759
755
|
|
@@ -763,9 +759,56 @@ module SendGridActionMailer
|
|
763
759
|
it 'adds that bcc address as a separate personalization' do
|
764
760
|
mailer.deliver!(mail)
|
765
761
|
expect(client.sent_mail['personalizations'].length).to eq(3)
|
766
|
-
expect(client.sent_mail['personalizations'][0]['bcc']).to eq([
|
767
|
-
expect(client.sent_mail['personalizations'][1]['bcc']).to eq(personalizations[
|
768
|
-
expect(client.sent_mail['personalizations'][2]['bcc']).to eq(
|
762
|
+
expect(client.sent_mail['personalizations'][0]['bcc']).to eq(personalizations[0]['bcc'])
|
763
|
+
expect(client.sent_mail['personalizations'][1]['bcc']).to eq(personalizations[1]['bcc'])
|
764
|
+
expect(client.sent_mail['personalizations'][2]['bcc']).to eq([{"email"=>"test@sendgrid.com"}])
|
765
|
+
end
|
766
|
+
end
|
767
|
+
|
768
|
+
context 'when perform_send_request false' do
|
769
|
+
it 'should not send and email and return json body' do
|
770
|
+
m = DeliveryMethod.new(perform_send_request: false, return_response: true, api_key: 'key')
|
771
|
+
response = m.deliver!(mail)
|
772
|
+
expect(response).to respond_to(:to_json)
|
773
|
+
end
|
774
|
+
end
|
775
|
+
|
776
|
+
context 'when mail_settings are present' do
|
777
|
+
it 'should apply mail_settings to request body' do
|
778
|
+
m = DeliveryMethod.new(api_key: 'key', return_response: true, mail_settings: { sandbox_mode: {enable: true }})
|
779
|
+
m.deliver!(mail)
|
780
|
+
expect(client.sent_mail['mail_settings']).to eq("sandbox_mode" => {"enable" => true })
|
781
|
+
end
|
782
|
+
|
783
|
+
context 'when mail has mail_settings set' do
|
784
|
+
before { mail['mail_settings'] = { spam_check: { enable: true } } }
|
785
|
+
|
786
|
+
it 'should combine local mail_settings with global settings' do
|
787
|
+
m = DeliveryMethod.new(api_key: 'key', return_response: true, mail_settings: { sandbox_mode: {enable: true }})
|
788
|
+
m.deliver!(mail)
|
789
|
+
expect(client.sent_mail['mail_settings']).to eq(
|
790
|
+
"sandbox_mode" => {"enable" => true },
|
791
|
+
"spam_check" => {"enable" => true },
|
792
|
+
)
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
context 'when mail contains the same setting as global settings' do
|
797
|
+
before do
|
798
|
+
mail['mail_settings'] = {
|
799
|
+
sandbox_mode: { enable: false },
|
800
|
+
spam_check: { enable: true }
|
801
|
+
}
|
802
|
+
end
|
803
|
+
|
804
|
+
it 'should apply local mail_settings on top of global settings' do
|
805
|
+
m = DeliveryMethod.new(api_key: 'key', return_response: true, mail_settings: { sandbox_mode: {enable: true }})
|
806
|
+
m.deliver!(mail)
|
807
|
+
expect(client.sent_mail['mail_settings']).to eq(
|
808
|
+
"sandbox_mode" => {"enable" => false },
|
809
|
+
"spam_check" => {"enable" => true },
|
810
|
+
)
|
811
|
+
end
|
769
812
|
end
|
770
813
|
end
|
771
814
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendgrid-actionmailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eddie Zaneski
|
8
8
|
- Kristján Pétursson
|
9
9
|
- Nick Muerdter
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mail
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '2.
|
21
|
+
version: '2.7'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '2.
|
28
|
+
version: '2.7'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: sendgrid-ruby
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,8 +128,6 @@ files:
|
|
128
128
|
- LICENSE.txt
|
129
129
|
- README.md
|
130
130
|
- Rakefile
|
131
|
-
- gemfiles/mail_2.5.gemfile
|
132
|
-
- gemfiles/mail_2.6.gemfile
|
133
131
|
- gemfiles/mail_2.7.gemfile
|
134
132
|
- lib/sendgrid-actionmailer.rb
|
135
133
|
- lib/sendgrid_actionmailer.rb
|
@@ -142,7 +140,7 @@ homepage: https://github.com/eddiezane/sendgrid-actionmailer
|
|
142
140
|
licenses:
|
143
141
|
- MIT
|
144
142
|
metadata: {}
|
145
|
-
post_install_message:
|
143
|
+
post_install_message:
|
146
144
|
rdoc_options: []
|
147
145
|
require_paths:
|
148
146
|
- lib
|
@@ -158,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
156
|
version: '0'
|
159
157
|
requirements: []
|
160
158
|
rubygems_version: 3.0.6
|
161
|
-
signing_key:
|
159
|
+
signing_key:
|
162
160
|
specification_version: 4
|
163
161
|
summary: SendGrid support for ActionMailer.
|
164
162
|
test_files:
|
data/gemfiles/mail_2.5.gemfile
DELETED