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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d75cda77ec587c85751c71dd79de21562a35e38562ae691dbd164ec86eae8bf
4
- data.tar.gz: 8ba014c01b1e37162bb96a7c6b2c00a59c8a6ad9ad7eef126cacd1046dd03d60
3
+ metadata.gz: 216459b27a5755c4aaadca781956a6ca22298ade1fabd652debec76cc3727864
4
+ data.tar.gz: 3876cce1f0c1cf0011cbc62bce448bf450124ac7639aea5b03010a6378ed0529
5
5
  SHA512:
6
- metadata.gz: 5c425f306373fd3a70490aacf0e55e312827bdf94b24f33d602bd3dd0335c66682f0352ed9ffe964e50c6dd4a6a99a4ec8cbcca24f1b2e7dfa6e195e63fd00be
7
- data.tar.gz: 91bf36ef8d4e4a1fd8de5e019f94f9486ae3ea106240256c7c8a08a84c3ebceceab49c348b26936ddc6162e32eb82739646a80b8df6df393855071acb353488e
6
+ metadata.gz: '0668df5a8839949ce2cfc252f8d86ed7beecf5c0ff0f6524a3215e5c79dbcbfa9279267be7790bec0e81634d74e943182cf2fe7ee2ef411de1346ca7f9d72918'
7
+ data.tar.gz: 9cee753e264ec435abe9a6fa468cb9521adba7d2914c00c811b8683bb39265df86dfec71b48bc9577d72bff174eec64adae9031ce0340cc56cc439fc2e82c1fd
@@ -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
- ### Chages
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
- ### Chages
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
- subject: 'email subject',
35
- body: 'email body',
36
- delivery_method_options: {
37
- api_key: 'SENDGRID_API_KEY'
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', mail_settings:{ bypass_list_management: { enable: true }})```
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', mail_settings:{ footer: { enable: true, text: 'FOOTER', html: '<h1>FOOTER</h1>' }})```
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', mail_settings:{ sandbox_mode: { enable: true }})```
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', mail_settings:{ spam_check: {enable: true, threshold: 1, post_to_url: 'https://spamcatcher.sendgrid.com'}})```
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
- ##### enable_text (boolean)
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', tracking_settings:{ enable: false, enable_text: false }})```
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', tracking_settings:{ enable: true, substitution_tag: 'Optional tag to replace with the open image in the body of the message' }})```
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', tracking_settings:{ 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' }})```
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', tracking_settings:{ enable: true, utm_source: 'some source', utm_medium: 'some medium', utm_term: 'some term', utm_content: 'some content', utm_campaign: 'some campaign' }})```
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. Variables are available within templates using [{{handlebar syntax}}](https://sendgrid.com/docs/for-developers/sending-email/using-handlebars).
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', dynamic_template_data:{ variable_1: 'foo', variable_2: 'bar'})```
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. This gem makes that modification to make the following Rails friendly unsubscribe urls.
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 = !!(result.body) ? JSON.parse(result.body).fetch('errors').pop.fetch('message') : 'Sendgrid API Error'
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)
@@ -1,3 +1,3 @@
1
1
  module SendGridActionMailer
2
- VERSION = '3.0.0'.freeze
2
+ VERSION = '3.0.1'.freeze
3
3
  end
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.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-02 00:00:00.000000000 Z
13
+ date: 2020-04-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mail