send_grid_mailer 0.3.0 → 0.4.0
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +6 -6
- data/lib/send_grid_mailer/definition.rb +2 -1
- data/lib/send_grid_mailer/deliverer.rb +4 -4
- data/lib/send_grid_mailer/mailer_base_ext.rb +4 -3
- data/lib/send_grid_mailer/version.rb +1 -1
- data/send_grid_mailer.gemspec +1 -1
- data/spec/dummy/log/test.log +38 -38
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6d6d84b5829afa21ab215e02bece2ccaba7d7ac
|
4
|
+
data.tar.gz: cae30204663988eda53caeebe064852b2faf96c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab1e75330adca90bcb39ef0084c0f930ee8b3974e7462da0d735f7efc441cd097514eb7db02e95b9b020ac20c7a828316db9a1e2587ce90a097073fc44152a0
|
7
|
+
data.tar.gz: 0d7c96e6ccad96a206b1693861a5df4e1ed8ced8a4e7f636551a6c8a48111f55bf1169d0abd4af8302e59fd73a8933313c78410aa64227084940580695d52a0f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
### v0.4.0
|
6
|
+
|
7
|
+
##### Changed
|
8
|
+
|
9
|
+
* Change Rails version to be "optimistic" in order to use the gem with Rails 5 too.
|
10
|
+
|
5
11
|
### v0.3.0
|
6
12
|
|
7
13
|
##### Added
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
send_grid_mailer (0.
|
5
|
-
rails (
|
4
|
+
send_grid_mailer (0.4.0)
|
5
|
+
rails (>= 4.2.0)
|
6
6
|
sendgrid-ruby (~> 4.0, >= 4.0.4)
|
7
7
|
|
8
8
|
GEM
|
@@ -63,8 +63,8 @@ GEM
|
|
63
63
|
railties (>= 3.0.0)
|
64
64
|
ffi (1.9.14)
|
65
65
|
formatador (0.2.5)
|
66
|
-
globalid (0.
|
67
|
-
activesupport (>= 4.
|
66
|
+
globalid (0.4.0)
|
67
|
+
activesupport (>= 4.2.0)
|
68
68
|
guard (2.14.0)
|
69
69
|
formatador (>= 0.2.4)
|
70
70
|
listen (>= 2.7, < 4.0)
|
@@ -163,8 +163,8 @@ GEM
|
|
163
163
|
rspec-support (~> 3.4.0)
|
164
164
|
rspec-support (3.4.1)
|
165
165
|
ruby_dep (1.4.0)
|
166
|
-
ruby_http_client (3.0.
|
167
|
-
sendgrid-ruby (4.0.
|
166
|
+
ruby_http_client (3.0.2)
|
167
|
+
sendgrid-ruby (4.0.8)
|
168
168
|
ruby_http_client (~> 3.0.1)
|
169
169
|
shellany (0.0.1)
|
170
170
|
simplecov (0.12.0)
|
@@ -16,7 +16,8 @@ module SendGridMailer
|
|
16
16
|
|
17
17
|
def substitute(key, value, default = "")
|
18
18
|
personalization.substitutions = SendGrid::Substitution.new(
|
19
|
-
key: key, value: value.to_s || default
|
19
|
+
key: key, value: value.to_s || default
|
20
|
+
)
|
20
21
|
end
|
21
22
|
|
22
23
|
def set_template_id(value)
|
@@ -26,8 +26,8 @@ module SendGridMailer
|
|
26
26
|
response = sg_api.client.templates.get
|
27
27
|
|
28
28
|
if response.status_code != "200"
|
29
|
-
|
30
|
-
|
29
|
+
m = "Error trying to get templates. Status Code: #{response.status_code}"
|
30
|
+
raise SendGridMailer::Exception.new(m)
|
31
31
|
end
|
32
32
|
|
33
33
|
JSON.parse(response.body)["templates"].each do |tpl|
|
@@ -35,8 +35,8 @@ module SendGridMailer
|
|
35
35
|
end
|
36
36
|
|
37
37
|
if !definition.template_id?
|
38
|
-
|
39
|
-
|
38
|
+
m = "No template with name #{definition.template_name}"
|
39
|
+
raise SendGridMailer::Exception.new(m)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -48,7 +48,7 @@ module ActionMailer
|
|
48
48
|
attachment.read,
|
49
49
|
attachment.filename,
|
50
50
|
attachment.content_type.to_s.split(";").first,
|
51
|
-
|
51
|
+
attachment.content_disposition =~ /inline/ ? 'inline' : 'attachment',
|
52
52
|
attachment.content_id
|
53
53
|
)
|
54
54
|
end
|
@@ -75,8 +75,9 @@ module ActionMailer
|
|
75
75
|
paths = Array(templates_path)
|
76
76
|
template = lookup_context.find_all(templates_name, paths).first
|
77
77
|
|
78
|
-
|
79
|
-
paths, templates_name, paths, false, 'mailer')
|
78
|
+
if !template
|
79
|
+
raise ActionView::MissingTemplate.new(paths, templates_name, paths, false, 'mailer')
|
80
|
+
end
|
80
81
|
|
81
82
|
set_content(render(template: template), template.type.to_s)
|
82
83
|
end
|
data/send_grid_mailer.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
s.test_files = Dir["spec/**/*"]
|
21
21
|
|
22
|
-
s.add_dependency "rails", "
|
22
|
+
s.add_dependency "rails", ">= 4.2.0"
|
23
23
|
s.add_dependency "sendgrid-ruby", "~> 4.0", ">= 4.0.4"
|
24
24
|
s.add_development_dependency "pry"
|
25
25
|
s.add_development_dependency "pry-rails"
|
data/spec/dummy/log/test.log
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
[1m[36m (
|
2
|
-
[1m[35m (0.
|
3
|
-
[1m[36m (
|
4
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.
|
5
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.
|
6
|
-
[1m[36m (
|
7
|
-
[1m[35m (0.
|
8
|
-
[1m[36m (
|
9
|
-
[1m[35m (0.
|
10
|
-
[1m[36m (
|
1
|
+
[1m[36m (3.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (2.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6
|
+
[1m[36m (7.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
7
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
8
|
+
[1m[36m (5.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
10
|
+
[1m[36m (6.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
11
11
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
12
12
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
13
13
|
[1m[35m (0.1ms)[0m rollback transaction
|
@@ -23,14 +23,14 @@
|
|
23
23
|
[1m[35m (0.1ms)[0m rollback transaction
|
24
24
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
25
25
|
[1m[35m (0.1ms)[0m rollback transaction
|
26
|
-
[1m[36m (0.
|
26
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
27
27
|
[1m[35m (0.1ms)[0m rollback transaction
|
28
28
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
29
29
|
[1m[35m (0.1ms)[0m rollback transaction
|
30
30
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
31
|
-
[1m[35m (0.
|
31
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
32
32
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
33
|
-
[1m[35m (0.
|
33
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
34
34
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
35
35
|
[1m[35m (0.1ms)[0m rollback transaction
|
36
36
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
@@ -39,7 +39,7 @@
|
|
39
39
|
[1m[35m (0.1ms)[0m rollback transaction
|
40
40
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
41
41
|
|
42
|
-
TestMailer#body_email: processed outbound mail in
|
42
|
+
TestMailer#body_email: processed outbound mail in 5.1ms
|
43
43
|
|
44
44
|
Subject: Body email
|
45
45
|
Template ID: -
|
@@ -56,10 +56,10 @@ Attachments: -
|
|
56
56
|
|
57
57
|
The E-mail was successfully sent :)
|
58
58
|
Status Code: 202
|
59
|
-
[1m[35m (0.
|
59
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
60
60
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
61
61
|
|
62
|
-
TestMailer#body_params_email: processed outbound mail in 0.
|
62
|
+
TestMailer#body_params_email: processed outbound mail in 0.4ms
|
63
63
|
|
64
64
|
Subject: Body params email
|
65
65
|
Template ID: -
|
@@ -78,9 +78,9 @@ The E-mail was successfully sent :)
|
|
78
78
|
Status Code: 202
|
79
79
|
[1m[35m (0.1ms)[0m rollback transaction
|
80
80
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
81
|
-
Rendered test_mailer/rails_tpl_email.html.erb within layouts/mailer (
|
81
|
+
Rendered test_mailer/rails_tpl_email.html.erb within layouts/mailer (1.2ms)
|
82
82
|
|
83
|
-
TestMailer#rails_tpl_email: processed outbound mail in
|
83
|
+
TestMailer#rails_tpl_email: processed outbound mail in 11.1ms
|
84
84
|
|
85
85
|
Subject: Rails tpl email
|
86
86
|
Template ID: -
|
@@ -106,7 +106,7 @@ Status Code: 202
|
|
106
106
|
[1m[35m (0.1ms)[0m rollback transaction
|
107
107
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
108
108
|
|
109
|
-
TestMailer#from_params_email: processed outbound mail in 0.
|
109
|
+
TestMailer#from_params_email: processed outbound mail in 0.5ms
|
110
110
|
|
111
111
|
Subject: From params email
|
112
112
|
Template ID: -
|
@@ -126,7 +126,7 @@ Status Code: 202
|
|
126
126
|
[1m[35m (0.1ms)[0m rollback transaction
|
127
127
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
128
128
|
|
129
|
-
TestMailer#from_email: processed outbound mail in 0.
|
129
|
+
TestMailer#from_email: processed outbound mail in 0.4ms
|
130
130
|
|
131
131
|
Subject: From email
|
132
132
|
Template ID: -
|
@@ -146,7 +146,7 @@ Status Code: 202
|
|
146
146
|
[1m[35m (0.1ms)[0m rollback transaction
|
147
147
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
148
148
|
|
149
|
-
TestMailer#recipients_params_email: processed outbound mail in 0.
|
149
|
+
TestMailer#recipients_params_email: processed outbound mail in 0.5ms
|
150
150
|
|
151
151
|
Subject: Recipients params email
|
152
152
|
Template ID: -
|
@@ -166,7 +166,7 @@ Status Code: 202
|
|
166
166
|
[1m[35m (0.1ms)[0m rollback transaction
|
167
167
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
168
168
|
|
169
|
-
TestMailer#recipients_email: processed outbound mail in 0.
|
169
|
+
TestMailer#recipients_email: processed outbound mail in 0.4ms
|
170
170
|
|
171
171
|
Subject: Recipients email
|
172
172
|
Template ID: -
|
@@ -186,7 +186,7 @@ Status Code: 202
|
|
186
186
|
[1m[35m (0.1ms)[0m rollback transaction
|
187
187
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
188
188
|
|
189
|
-
TestMailer#template_id_params_email: processed outbound mail in 0.
|
189
|
+
TestMailer#template_id_params_email: processed outbound mail in 0.4ms
|
190
190
|
|
191
191
|
Subject: Template id params email
|
192
192
|
Template ID: XXX
|
@@ -201,10 +201,10 @@ Attachments: -
|
|
201
201
|
|
202
202
|
The E-mail was successfully sent :)
|
203
203
|
Status Code: 202
|
204
|
-
[1m[35m (0.
|
204
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
205
205
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
206
206
|
|
207
|
-
TestMailer#template_id_email: processed outbound mail in 0.
|
207
|
+
TestMailer#template_id_email: processed outbound mail in 0.4ms
|
208
208
|
|
209
209
|
Subject: Template id email
|
210
210
|
Template ID: XXX
|
@@ -222,7 +222,7 @@ Status Code: 202
|
|
222
222
|
[1m[35m (0.1ms)[0m rollback transaction
|
223
223
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
224
224
|
|
225
|
-
TestMailer#subject_params_email: processed outbound mail in 0.
|
225
|
+
TestMailer#subject_params_email: processed outbound mail in 0.3ms
|
226
226
|
|
227
227
|
Subject: My Subject
|
228
228
|
Template ID: -
|
@@ -242,7 +242,7 @@ Status Code: 202
|
|
242
242
|
[1m[35m (0.1ms)[0m rollback transaction
|
243
243
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
244
244
|
|
245
|
-
TestMailer#subject_email: processed outbound mail in 0.
|
245
|
+
TestMailer#subject_email: processed outbound mail in 0.4ms
|
246
246
|
|
247
247
|
Subject: My Subject
|
248
248
|
Template ID: -
|
@@ -259,10 +259,10 @@ Attachments: -
|
|
259
259
|
|
260
260
|
The E-mail was successfully sent :)
|
261
261
|
Status Code: 202
|
262
|
-
[1m[35m (0.
|
262
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
263
263
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
264
264
|
|
265
|
-
TestMailer#headers_params_email: processed outbound mail in 0.
|
265
|
+
TestMailer#headers_params_email: processed outbound mail in 0.4ms
|
266
266
|
|
267
267
|
Subject: Headers params email
|
268
268
|
Template ID: -
|
@@ -284,7 +284,7 @@ Status Code: 202
|
|
284
284
|
[1m[35m (0.1ms)[0m rollback transaction
|
285
285
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
286
286
|
|
287
|
-
TestMailer#headers_email: processed outbound mail in
|
287
|
+
TestMailer#headers_email: processed outbound mail in 1.2ms
|
288
288
|
|
289
289
|
Subject: Headers email
|
290
290
|
Template ID: -
|
@@ -306,7 +306,7 @@ Status Code: 202
|
|
306
306
|
[1m[35m (0.1ms)[0m rollback transaction
|
307
307
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
308
308
|
|
309
|
-
TestMailer#add_attachments_email: processed outbound mail in
|
309
|
+
TestMailer#add_attachments_email: processed outbound mail in 9.3ms
|
310
310
|
|
311
311
|
Subject: Add attachments email
|
312
312
|
Template ID: -
|
@@ -324,10 +324,10 @@ Attachments:
|
|
324
324
|
|
325
325
|
The E-mail was successfully sent :)
|
326
326
|
Status Code: 202
|
327
|
-
[1m[35m (0.
|
328
|
-
[1m[36m (0.
|
327
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
328
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
329
329
|
|
330
|
-
TestMailer#substitutions_email: processed outbound mail in 0.
|
330
|
+
TestMailer#substitutions_email: processed outbound mail in 0.6ms
|
331
331
|
|
332
332
|
Subject: Substitutions email
|
333
333
|
Template ID: -
|
@@ -349,7 +349,7 @@ Status Code: 202
|
|
349
349
|
[1m[35m (0.1ms)[0m rollback transaction
|
350
350
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
351
351
|
|
352
|
-
TestMailer#template_name_email: processed outbound mail in 0.
|
352
|
+
TestMailer#template_name_email: processed outbound mail in 0.4ms
|
353
353
|
|
354
354
|
Subject: Template name email
|
355
355
|
Template ID: 123
|
@@ -367,9 +367,9 @@ Status Code: 202
|
|
367
367
|
[1m[35m (0.1ms)[0m rollback transaction
|
368
368
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
369
369
|
|
370
|
-
TestMailer#template_name_email: processed outbound mail in 0.
|
370
|
+
TestMailer#template_name_email: processed outbound mail in 0.5ms
|
371
371
|
[1m[35m (0.1ms)[0m rollback transaction
|
372
372
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
373
373
|
|
374
|
-
TestMailer#template_name_email: processed outbound mail in 0.
|
375
|
-
[1m[35m (0.
|
374
|
+
TestMailer#template_name_email: processed outbound mail in 0.4ms
|
375
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: send_grid_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platanus
|
@@ -9,15 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '4.2'
|
21
18
|
- - ">="
|
22
19
|
- !ruby/object:Gem::Version
|
23
20
|
version: 4.2.0
|
@@ -25,9 +22,6 @@ dependencies:
|
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
|
-
- - "~>"
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: '4.2'
|
31
25
|
- - ">="
|
32
26
|
- !ruby/object:Gem::Version
|
33
27
|
version: 4.2.0
|