Add a SiteSetting to configure how many topics are in the email digest.

This commit is contained in:
Robin Ward 2014-04-21 14:44:00 -04:00
parent 64b8f2f759
commit 4eb5474858
3 changed files with 3 additions and 1 deletions

View file

@ -42,7 +42,7 @@ class UserNotifications < ActionMailer::Base
@last_seen_at = I18n.l(@user.last_seen_at || @user.created_at, format: :short)
# A list of topics to show the user
@featured_topics = Topic.for_digest(user, min_date, limit: 20, top_order: true).to_a
@featured_topics = Topic.for_digest(user, min_date, limit: SiteSetting.digest_topics, top_order: true).to_a
# Don't send email unless there is content in it
if @featured_topics.present?

View file

@ -838,6 +838,7 @@ en:
allow_uploaded_avatars: "Allow users to upload their custom avatars"
allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:regenerate rake task after changing that setting."
digest_topics: "The maximum amount of topics to display in an email digest"
digest_min_excerpt_length: "How many characters we're aiming for for each post in the email digest"
default_digest_email_frequency: "How often users receive digest emails by default. They can change this setting in their preferences."
default_external_links_in_new_tab: "Open external links in a new tab. Users can change this in their preferences."

View file

@ -253,6 +253,7 @@ email:
email_time_window_mins: 10
email_posts_context: 5
digest_min_excerpt_length: 100
digest_topics: 20
default_digest_email_frequency:
default: 7
enum: 'DigestEmailSiteSetting'