sendgrid-actionmailer 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/README.md +21 -19
- data/lib/sendgrid_actionmailer.rb +1 -1
- data/lib/sendgrid_actionmailer/version.rb +1 -1
- 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: 216459b27a5755c4aaadca781956a6ca22298ade1fabd652debec76cc3727864
|
4
|
+
data.tar.gz: 3876cce1f0c1cf0011cbc62bce448bf450124ac7639aea5b03010a6378ed0529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0668df5a8839949ce2cfc252f8d86ed7beecf5c0ff0f6524a3215e5c79dbcbfa9279267be7790bec0e81634d74e943182cf2fe7ee2ef411de1346ca7f9d72918'
|
7
|
+
data.tar.gz: 9cee753e264ec435abe9a6fa468cb9521adba7d2914c00c811b8683bb39265df86dfec71b48bc9577d72bff174eec64adae9031ce0340cc56cc439fc2e82c1fd
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 3.0.1 - 2020-4-3
|
4
|
+
|
5
|
+
### Changes
|
6
|
+
|
7
|
+
- Validate error response body for empty string
|
8
|
+
|
3
9
|
## 3.0.0 - 2020-3-2
|
4
10
|
|
5
11
|
### Removed
|
@@ -8,13 +14,13 @@
|
|
8
14
|
|
9
15
|
## 2.6.0 - 2020-1-23
|
10
16
|
|
11
|
-
###
|
17
|
+
### Changes
|
12
18
|
|
13
19
|
- Dont send content types with dynamic templates (#69)
|
14
20
|
|
15
21
|
## 2.5.0 - 2020-1-21
|
16
22
|
|
17
|
-
###
|
23
|
+
### Changes
|
18
24
|
|
19
25
|
- Add personalizations field (#60)
|
20
26
|
|
data/README.md
CHANGED
@@ -31,11 +31,12 @@ If you need to send mail for a number of Sendgrid accounts, you can set the API
|
|
31
31
|
|
32
32
|
```ruby
|
33
33
|
mail(to: 'example@email.com',
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
subject: 'email subject',
|
35
|
+
body: 'email body',
|
36
|
+
delivery_method_options: {
|
37
|
+
api_key: 'SENDGRID_API_KEY'
|
38
|
+
}
|
39
|
+
)
|
39
40
|
```
|
40
41
|
|
41
42
|
## SendGrid Mail Extensions
|
@@ -86,7 +87,7 @@ The unsubscribe group to associate with this email.
|
|
86
87
|
#### groups_to_display (array[integer])
|
87
88
|
An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.
|
88
89
|
|
89
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', asm: group_id: 99, groups_to_display: [4,5,6,7,8])```
|
90
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', asm: { group_id: 99, groups_to_display: [4,5,6,7,8] })```
|
90
91
|
|
91
92
|
### ip_pool_name (string)
|
92
93
|
The IP Pool that you would like to send this email from.
|
@@ -105,7 +106,7 @@ Indicates if this setting is enabled.
|
|
105
106
|
##### email (string)
|
106
107
|
The email address that you would like to receive the BCC.
|
107
108
|
|
108
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: {bcc: {enable: true, email: 'bcc@example.com}})```
|
109
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { bcc: { enable: true, email: 'bcc@example.com }})```
|
109
110
|
|
110
111
|
#### bypass_list_management (object)
|
111
112
|
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 +114,7 @@ Allows you to bypass all unsubscribe groups and suppressions to ensure that the
|
|
113
114
|
###### enable (boolean)
|
114
115
|
Indicates if this setting is enabled.
|
115
116
|
|
116
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
117
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { bypass_list_management: { enable: true }})```
|
117
118
|
|
118
119
|
#### footer (object)
|
119
120
|
The default footer that you would like included on every email.
|
@@ -127,7 +128,7 @@ The plain text content of your footer.
|
|
127
128
|
##### html (string)
|
128
129
|
The HTML content of your footer.
|
129
130
|
|
130
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
131
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { footer: { enable: true, text: 'FOOTER', html: '<h1>FOOTER</h1>' }})```
|
131
132
|
|
132
133
|
#### sandbox_mode (object)
|
133
134
|
This allows you to send a test email to ensure that your request body is valid and formatted correctly.
|
@@ -135,7 +136,7 @@ This allows you to send a test email to ensure that your request body is valid a
|
|
135
136
|
##### enable (boolean)
|
136
137
|
Indicates if this setting is enabled.
|
137
138
|
|
138
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
139
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', mail_settings: { sandbox_mode: { enable: true }})```
|
139
140
|
|
140
141
|
#### spam_check (object)
|
141
142
|
This allows you to test the content of your email for spam.
|
@@ -149,7 +150,8 @@ The threshold used to determine if your content qualifies as spam on a scale fro
|
|
149
150
|
##### post_to_url (string)
|
150
151
|
An Inbound Parse URL that you would like a copy of your email along with the spam report to be sent to.
|
151
152
|
|
152
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
153
|
+
```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' }})```
|
154
|
+
|
153
155
|
### tracking_settings(json)
|
154
156
|
Settings to determine how you would like to track the metrics of how your recipients interact with your email.
|
155
157
|
|
@@ -159,10 +161,10 @@ Allows you to track whether a recipient clicked a link in your email.
|
|
159
161
|
##### enable (boolean)
|
160
162
|
Indicates if this setting is enabled.
|
161
163
|
|
162
|
-
#####
|
164
|
+
##### enable_text (boolean)
|
163
165
|
Indicates if this setting should be included in the text/plain portion of your email.
|
164
166
|
|
165
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
167
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', tracking_settings: { click_tracking: { enable: false, enable_text: false }})```
|
166
168
|
|
167
169
|
#### open_tracking (object)
|
168
170
|
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 +175,7 @@ Indicates if this setting is enabled.
|
|
173
175
|
##### substitution_tag (string)
|
174
176
|
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
177
|
|
176
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
178
|
+
```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
179
|
|
178
180
|
#### subscription_tracking (object)
|
179
181
|
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 +192,7 @@ HTML to be appended to the email, with the subscription tracking link. You may c
|
|
190
192
|
##### substitution_tag (string)
|
191
193
|
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
194
|
|
193
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
195
|
+
```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
196
|
|
195
197
|
#### ganalytics (object)
|
196
198
|
Allows you to enable tracking provided by Google Analytics.
|
@@ -213,13 +215,13 @@ Used to differentiate your campaign from advertisements.
|
|
213
215
|
##### utm_campaign (string)
|
214
216
|
The name of the campaign.
|
215
217
|
|
216
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
218
|
+
```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
219
|
|
218
220
|
### dynamic_template_data (json)
|
219
221
|
|
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.
|
222
|
+
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
223
|
|
222
|
-
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body',
|
224
|
+
```mail(to: 'example@email.com', subject: 'email subject', body: 'email body', dynamic_template_data: { variable_1: 'foo', variable_2: 'bar' })```
|
223
225
|
|
224
226
|
### personalizations (json)
|
225
227
|
|
@@ -255,7 +257,7 @@ mail(subject: 'default subject', 'email body', personalizations: [
|
|
255
257
|
|
256
258
|
### Unsubscribe Links
|
257
259
|
|
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.
|
260
|
+
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
261
|
|
260
262
|
* `<a href="%asm_group_unsubscribe_raw_url%">Unsubscribe</a>`
|
261
263
|
* `<a href="%asm_global_unsubscribe_raw_url%">Unsubscribe from List</a>`
|
@@ -280,7 +280,7 @@ module SendGridActionMailer
|
|
280
280
|
result = client.mail._('send').post(request_body: email.to_json) # ლ(ಠ益ಠლ) that API
|
281
281
|
|
282
282
|
if result.status_code && result.status_code.start_with?('4')
|
283
|
-
message =
|
283
|
+
message = !(result.body.empty?) ? JSON.parse(result.body).fetch('errors').pop.fetch('message') : 'Sendgrid API Error'
|
284
284
|
full_message = "Sendgrid delivery failed with #{result.status_code} #{message}"
|
285
285
|
|
286
286
|
settings[:raise_delivery_errors] ? raise(SendgridDeliveryError, full_message) : warn(full_message)
|
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.0.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: 2020-03
|
13
|
+
date: 2020-04-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mail
|