diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb
index e627ccbdef1..101cb4fb55d 100644
--- a/app/mailers/user_notifications.rb
+++ b/app/mailers/user_notifications.rb
@@ -44,6 +44,10 @@ class UserNotifications < ActionMailer::Base
# Don't send email unless there is content in it
if @featured_topics.present?
@featured_topics, @new_topics = @featured_topics[0..4], @featured_topics[5..-1]
+
+ # Sort the new topics by score
+ @new_topics.sort! {|a, b| b.score - a.score } if @new_topics.present?
+
@markdown_linker = MarkdownLinker.new(Discourse.base_url)
build_email user.email,
diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb
index 1937897327c..d53cf14bafa 100644
--- a/app/views/user_notifications/digest.html.erb
+++ b/app/views/user_notifications/digest.html.erb
@@ -31,7 +31,13 @@
<%- @new_topics.each do |t| %>
- - <%= link_to t.title, t.relative_url %> <%- if t.category %>[<%= t.category.name %>]<%- end %>
+ -
+ <%= link_to t.title, t.relative_url %>
+
+ <%= t('user_notifications.digest.posts', count: t.posts_count) %>
+
+ <%- if t.category %><%= t.category.name %><%- end %>
+
<%- end -%>
diff --git a/app/views/user_notifications/digest.text.erb b/app/views/user_notifications/digest.text.erb
index edf9622ddd3..f05ed22ff4a 100644
--- a/app/views/user_notifications/digest.text.erb
+++ b/app/views/user_notifications/digest.text.erb
@@ -25,7 +25,7 @@
**<%=t 'user_notifications.digest.other_new_topics' %>**
<%- @new_topics.each do |t| %>
-* <%= raw(@markdown_linker.create(t.title, t.relative_url)) %> <%- if t.category %>[<%= t.category.name %>]<%- end %>
+* <%= raw(@markdown_linker.create(t.title, t.relative_url)) %> - <%= t('user_notifications.digest.posts', count: t.posts_count) %> - <%- if t.category %>[<%= t.category.name %>]<%- end %>
<%- end -%>
<%- end -%>
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 876834c0403..2fa9124ea9d 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -79,7 +79,7 @@ en:
education:
until_posts:
- one: "post"
+ one: "1 post"
other: "%{count} posts"
'new-topic': |
@@ -1117,6 +1117,10 @@ en:
from: "%{site_name} digest"
read_more: "Read More"
+ posts:
+ one: "1 post"
+ other: "%{count} posts"
+
forgot_password:
subject_template: "[%{site_name}] Password reset"
text_body_template: |
diff --git a/lib/email/styles.rb b/lib/email/styles.rb
index 041ac01e261..7a13181fa16 100644
--- a/lib/email/styles.rb
+++ b/lib/email/styles.rb
@@ -60,6 +60,7 @@ module Email
style('div.digest-post h1', 'font-size: 20px;')
style('span.footer-notice', 'color:#666; font-size:80%')
+ style('span.post-count', 'margin: 0 5px; color: #777;')
style('pre', 'white-space: pre-wrap')
style('code', 'background-color: f1f1ff; padding: 2px 5px;')
style('pre code', 'display: block; background-color: f1f1ff; padding: 5px')