effective_email_templates 1.0.12 → 1.0.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea4dc4be1510a05879a7ff2c084a17126b4d8bcaa228c693a7cb8a4093a2ffc
|
4
|
+
data.tar.gz: 74936efb073fc46f09e04d8543858c2a667e4737eeccc86b64882d1f5d9cf402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cefe7ba9a4d3da5a15e4f1e7429167e7ff1d3570f2b381f5ca2c4a2f1379066748a6b0436868099badf1eb3ea178ba347f2d7889ea170b1108e14c80f0d1d61
|
7
|
+
data.tar.gz: d1e69f8c657c791cc2af22be8ef22fb5a0c4acecb1670727fc9e83b6e6de0ad0f3c9972f8990c3251b0b569148a23c763d64157a55a2ccb6c850bc11f969b200
|
@@ -3,20 +3,22 @@ module Effective
|
|
3
3
|
|
4
4
|
def mail(headers = {}, &block)
|
5
5
|
email_template = Effective::EmailTemplate.where(template_name: action_name).first!
|
6
|
-
|
7
|
-
# Parse Assigns. :body is a special key
|
8
6
|
assigns = (@assigns || {})
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
# Parse assigns. Special keys for body and subject.
|
9
|
+
body = assigns.delete(:body) || headers[:body] || headers['body']
|
10
|
+
email_template.body = body if body.present?
|
11
|
+
|
12
|
+
subject = assigns.delete(:subject) || headers[:subject] || headers['subject']
|
13
|
+
email_template.subject = subject if subject.present?
|
13
14
|
|
15
|
+
# Add any _url helpers
|
14
16
|
assigns = route_url_assigns(email_template).merge(assigns)
|
15
17
|
|
16
18
|
# Render from the template, possibly with updated body
|
17
19
|
rendered = email_template.render(assigns)
|
18
20
|
|
19
|
-
super(rendered.merge(headers))
|
21
|
+
super(rendered.merge(headers.except(:body, :subject, 'body', 'subject')))
|
20
22
|
end
|
21
23
|
|
22
24
|
private
|
@@ -73,11 +73,11 @@ module Effective
|
|
73
73
|
private
|
74
74
|
|
75
75
|
def template_body
|
76
|
-
Liquid::Template.parse(
|
76
|
+
Liquid::Template.parse(body)
|
77
77
|
end
|
78
78
|
|
79
79
|
def template_subject
|
80
|
-
Liquid::Template.parse(
|
80
|
+
Liquid::Template.parse(subject)
|
81
81
|
end
|
82
82
|
|
83
83
|
def deep_stringify_assigns(assigns)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_email_templates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|