Basic "Also, there are x new topics" text for the digest

This commit is contained in:
Robin Ward 2014-04-17 16:04:26 -04:00
parent fd4007eefc
commit 0e56157212
3 changed files with 11 additions and 0 deletions

View File

@ -45,9 +45,15 @@ class UserNotifications < ActionMailer::Base
# Don't send email unless there is content in it
if @featured_topics.present?
@new_topics_since_seen = Topic.listable_topics
.where("created_at > ?", min_date).count - @featured_topics.length
@new_topics_since_seen = 0 if @new_topics_since_seen < 0
@featured_topics, @new_topics = @featured_topics[0..4], @featured_topics[5..-1]
@markdown_linker = MarkdownLinker.new(Discourse.base_url)
build_email user.email,
from_alias: I18n.t('user_notifications.digest.from', site_name: SiteSetting.title),
subject: I18n.t('user_notifications.digest.subject_template',

View File

@ -44,6 +44,10 @@
<%- end -%>
<%- if @new_topics_since_seen > 0 %>
<p><%= t('user_notifications.digest.more_topics', last_seen_at: @last_seen_at, new_topics_since_seen: @new_topics_since_seen) %></p>
<%- end -%>
<span class='footer-notice'>
<%=raw(t :'user_notifications.digest.unsubscribe',
site_link: html_site_link,

View File

@ -1360,6 +1360,7 @@ en:
click_here: "click here"
from: "%{site_name} digest"
read_more: "Read More"
more_topics: "Also, since we last saw you on %{last_seen_at} there have been %{new_topics_since_seen} new topics posted."
posts:
one: "1 post"