effective_email_templates 1.6.0 → 1.7.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d32e71af524fb3658debbf8210a4239b4bbd98f7a806f0a743735e62bc135dc
|
4
|
+
data.tar.gz: f6064f01a1a679b3c4bf1abca99222ab4ba191d4bb0ee16a1ac23ddad644c368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 360328a697866d2d802d7c882bcfbd9c0be6e148c0b6d98114417088af72b9ea74cc935d275b6396a8be64becd88749536f491b1cfcb0f953e8ab1c739ba276e
|
7
|
+
data.tar.gz: 5cad8e018ad138e6050278c36e39a69a631a06773bc8d87aeee9986a96b56de9ab3f491198634eea514126f30241a0536b2b8ccceb9721f5e6a7da928e7f0b63
|
@@ -15,10 +15,11 @@ module EffectiveEmailTemplatesMailer
|
|
15
15
|
|
16
16
|
# Parse subject content if explicitly given
|
17
17
|
# Otherwise the :subject key is a default and should be ignored in favor of the email template subject instead
|
18
|
-
subject = assigns.delete(:subject)
|
19
|
-
subject ||= (headers[:subject] || headers['subject']) if (headers[:custom_subject] || headers['custom_subject'])
|
18
|
+
subject = assigns.delete(:subject) || headers[:subject] || headers['subject']
|
20
19
|
email_template.subject = subject if subject.present?
|
21
20
|
|
21
|
+
# If the body or subject are nil, they will be populated from the email_template
|
22
|
+
|
22
23
|
# Add any _url helpers
|
23
24
|
assigns = route_url_assigns(email_template, assigns).merge(assigns)
|
24
25
|
|
@@ -26,7 +27,20 @@ module EffectiveEmailTemplatesMailer
|
|
26
27
|
rendered = email_template.render(assigns)
|
27
28
|
|
28
29
|
# Merge any other passed values
|
29
|
-
merged = rendered.merge(headers.except(:body, :subject,
|
30
|
+
merged = rendered.merge(headers.except(:body, :subject, 'body', 'subject'))
|
31
|
+
|
32
|
+
# Finalize the subject_for Proc
|
33
|
+
if respond_to?(:subject_for) # EffectiveResourcesMailer
|
34
|
+
if (prefix = EffectiveResources.mailer_subject_prefix_hint).present?
|
35
|
+
subject = subject_for(action_name, merged[:subject], email_template, merged)
|
36
|
+
|
37
|
+
if subject.start_with?("#{prefix}#{prefix}") || subject.start_with?("#{prefix} #{prefix}")
|
38
|
+
subject = subject.sub(prefix, '')
|
39
|
+
end
|
40
|
+
|
41
|
+
merged[:subject] = subject
|
42
|
+
end
|
43
|
+
end
|
30
44
|
|
31
45
|
super(merged)
|
32
46
|
end
|
@@ -4,11 +4,15 @@
|
|
4
4
|
- if EffectiveEmailTemplates.select_content_type
|
5
5
|
= f.select :content_type, Effective::EmailTemplate::CONTENT_TYPES
|
6
6
|
|
7
|
-
= f.select :from,
|
7
|
+
= f.select :from, mailer_froms_collection(), hint: 'Please contact us to add additional sender addresses. Please refresh the page if this from address looks weird.'
|
8
8
|
= f.text_field :cc
|
9
9
|
= f.text_field :bcc
|
10
10
|
|
11
|
-
=
|
11
|
+
- prefix_hint = EffectiveResources.mailer_subject_prefix_hint.to_s.strip.presence
|
12
|
+
|
13
|
+
= f.text_field :subject,
|
14
|
+
hint: (prefix_hint ? "The subject of your email. It will be automatically prefixed with #{prefix_hint}." : 'The subject of your email')
|
15
|
+
|
12
16
|
= f.text_area :body, hint: 'The content of your email template', rows: 10
|
13
17
|
|
14
18
|
.card
|
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.
|
4
|
+
version: 1.7.0
|
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: 2023-10-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|