diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index 01cd1ed6560..8b3db7ee640 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -47,7 +47,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
-
+
@@ -58,13 +58,13 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo @@ -123,7 +123,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo @@ -215,8 +215,8 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- +
<%- @counts.each do |count| -%> - <%- end -%> <%- @counts.each do |count| -%> - <%- end -%>

-
<%=t 'user_notifications.digest.since_last_visit' %>
+
<%=t 'user_notifications.digest.since_last_visit' %>
@@ -72,22 +72,22 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- <%= count[:value] -%> + + <%= count[:value] -%>
- <%=t count[:label_key] -%> + + <%=t count[:label_key] -%>
-
<%=t 'user_notifications.digest.popular_topics' %>
+
<%=t 'user_notifications.digest.popular_topics' %>

- + <%= t.title.truncate(60, separator: /\s/) -%>

@@ -189,7 +189,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo <% end %>
- + <%=t 'user_notifications.digest.join_the_discussion' %>
- -
+ +
@@ -286,9 +286,9 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo @@ -331,12 +331,12 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo

<%=t 'user_notifications.digest.from_topic_label' %> - <%= post.topic.title.truncate(60, separator: /\s/) -%> + <%= post.topic.title.truncate(60, separator: /\s/) -%>

- + <%=t 'user_notifications.digest.join_the_discussion' %>
-

+

<%= t.user_data ? (t.highest_post_number - (t.user_data.last_read_post_number || 0)) : t.highest_post_number %>

- + <%= t.title.truncate(60, separator: /\s/) -%> <%- if SiteSetting.show_topic_featured_link_in_digest && t.featured_link %> diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 2260ce3ab94..8d36e36d2ee 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1306,6 +1306,9 @@ en: delete_digest_email_after_days: "Suppress summary emails for users not seen on the site for more than (n) days." digest_suppress_categories: "Suppress these categories from summary emails." disable_digest_emails: "Disable summary emails for all users." + email_accent_bg_color: "The accent color to be used as the background of some elements in HTML emails. Enter a color name ('red') or hex value ('#FF000')." + email_accent_fg_color: "The color of text rendered on the email bg color in HTML emails. Enter a color name ('white') or hex value ('#FFFFFF')." + email_link_color: "The color of links in HTML emails. Enter a color name ('blue') or hex value ('#0000FF')." detect_custom_avatars: "Whether or not to check that users have uploaded custom profile pictures." max_daily_gravatar_crawls: "Maximum number of times Discourse will check Gravatar for custom avatars in a day" diff --git a/config/site_settings.yml b/config/site_settings.yml index 1d4eaee0a33..4eeb9489e1c 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -599,6 +599,9 @@ email: disable_digest_emails: default: false client: true + email_accent_bg_color: "#2F70AC" + email_accent_fg_color: "#FFFFFF" + email_link_color: "#006699" show_topic_featured_link_in_digest: false email_custom_headers: 'Auto-Submitted: auto-generated' email_subject: '[%{site_name}] %{optional_pm}%{optional_cat}%{topic_title}' diff --git a/lib/email/styles.rb b/lib/email/styles.rb index 39adcf88cd1..8db24d48672 100644 --- a/lib/email/styles.rb +++ b/lib/email/styles.rb @@ -152,20 +152,19 @@ module Email end def format_html + style('.with-accent-colors', "background-color: #{SiteSetting.email_accent_bg_color}; color: #{SiteSetting.email_accent_fg_color};") style('h4', 'color: #222;') style('h3', 'margin: 15px 0 20px 0;') style('hr', 'background-color: #ddd; height: 1px; border: 1px;') - style('a', 'text-decoration: none; font-weight: bold; color: #006699;') + style('a', "text-decoration: none; font-weight: bold; color: #{SiteSetting.email_link_color};") style('ul', 'margin: 0 0 0 10px; padding: 0 0 0 20px;') style('li', 'padding-bottom: 10px') - style('div.digest-post', 'margin-left: 15px; margin-top: -5px; max-width: 694px;') - style('div.digest-post h1', 'font-size: 20px;') style('div.footer', 'color:#666; font-size:95%; text-align:center; padding-top:15px;') style('span.post-count', 'margin: 0 5px; color: #777;') style('pre', 'word-wrap: break-word; max-width: 694px;') style('code', 'background-color: #f1f1ff; padding: 2px 5px;') style('pre code', 'display: block; background-color: #f1f1ff; padding: 5px;') - style('.featured-topic a', 'text-decoration: none; font-weight: bold; color: #006699; line-height:1.5em;') + style('.featured-topic a', "text-decoration: none; font-weight: bold; color: #{SiteSetting.email_link_color}; line-height:1.5em;") onebox_styles plugin_styles