diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb
index a08366feb59..e36dc33c65b 100644
--- a/app/helpers/user_notifications_helper.rb
+++ b/app/helpers/user_notifications_helper.rb
@@ -68,4 +68,15 @@ module UserNotificationsHelper
def cooked_post_for_email(post)
PrettyText.format_for_email(post.cooked).html_safe
end
+
+
+ def email_category(category)
+ return "" if category.blank? || category.uncategorized?
+ result = ""
+ if category.parent_category.present?
+ result << " "
+ end
+ result << "#{category.name}"
+ result.html_safe
+ end
end
diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb
index 0323f69e2e9..ba8fa42fdf6 100644
--- a/app/views/user_notifications/digest.html.erb
+++ b/app/views/user_notifications/digest.html.erb
@@ -13,7 +13,10 @@
+ <%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
+ <%= email_category(t.category) %>
+
<%- if t.best_post.present? %>
@@ -33,12 +36,8 @@
-
<%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
-
<%= t('user_notifications.digest.posts', count: t.posts_count) %>
-
- <%- if t.category && !t.category.uncategorized? %>
- <%- if t.category.parent_category %> <%- end %><%= t.category.name %>
- <%- end %>
+ <%= email_category(t.category) %>
<%- end -%>
diff --git a/lib/email/styles.rb b/lib/email/styles.rb
index d1f2be693ff..88cbbeeafb4 100644
--- a/lib/email/styles.rb
+++ b/lib/email/styles.rb
@@ -53,7 +53,7 @@ module Email
def format_html
style('h3', 'margin: 15px 0 20px 0; border-bottom: 1px solid #ddd;')
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: #006699;')
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: 20px; max-width: 694px;')
@@ -63,6 +63,7 @@ module Email
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; margin-right: 5px')
# Links to other topics
style('aside.quote', 'border-left: 5px solid #bebebe; background-color: #f1f1f1; padding: 12px;')