From 576a4241308a60bf012e7058dd661a3751a21311 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 1 Dec 2016 14:20:01 -0500 Subject: [PATCH] FEATURE: number of new topics at the end of summary email can be controlled by a new setting, digest_other_topics --- app/mailers/user_notifications.rb | 2 +- config/locales/server.en.yml | 3 ++- config/site_settings.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index e15544fd64d..b4f2b76559b 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -130,7 +130,7 @@ class UserNotifications < ActionMailer::Base end # Now fetch some topics and posts to show - topics_for_digest = Topic.for_digest(user, min_date, limit: SiteSetting.digest_topics + 3, top_order: true).to_a + topics_for_digest = Topic.for_digest(user, min_date, limit: SiteSetting.digest_topics + SiteSetting.digest_other_topics, top_order: true).to_a @popular_topics = topics_for_digest[0,SiteSetting.digest_topics] @other_new_for_you = topics_for_digest.size > SiteSetting.digest_topics ? topics_for_digest[SiteSetting.digest_topics..-1] : [] diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index bf472741990..8c10bd7f822 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1286,8 +1286,9 @@ en: allow_animated_thumbnails: "Generates animated thumbnails of animated gifs." default_avatars: "URLs to avatars that will be used by default for new users until they change them." automatically_download_gravatars: "Download Gravatars for users upon account creation or email change." - digest_topics: "The maximum number of topics to display in the email summary." + digest_topics: "The maximum number of popular topics to display in the email summary." digest_posts: "The maximum number of popular posts to display in the email summary." + digest_other_topics: "The maximum number of topics to show in the 'New in topics and categories you follow' section of the email summary." digest_min_excerpt_length: "Minimum post excerpt in the email summary, in characters." 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." diff --git a/config/site_settings.yml b/config/site_settings.yml index b6f233ebc7f..40ff14fda4d 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -588,6 +588,7 @@ email: default: 5 min: 1 digest_posts: 3 + digest_other_topics: 5 delete_digest_email_after_days: 365 digest_suppress_categories: type: category_list