mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
Include a list of more new topics in the digest emails at the bottom
This commit is contained in:
parent
730f57a751
commit
652169daf6
|
@ -39,11 +39,13 @@ 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
|
||||
@new_topics = Topic.for_digest(user, min_date)
|
||||
@markdown_linker = MarkdownLinker.new(Discourse.base_url)
|
||||
@featured_topics = Topic.for_digest(user, min_date).to_a
|
||||
|
||||
# Don't send email unless there is content in it
|
||||
if @new_topics.present?
|
||||
if @featured_topics.present?
|
||||
@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',
|
||||
|
|
|
@ -200,7 +200,7 @@ class Topic < ActiveRecord::Base
|
|||
.created_since(since)
|
||||
.listable_topics
|
||||
.order(:percent_rank)
|
||||
.limit(5)
|
||||
.limit(100)
|
||||
end
|
||||
|
||||
def update_meta_data(data)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<tr>
|
||||
<td style="padding: 10px 10px; background-color: #eee; border: 1px solid #ddd;">
|
||||
<a href="<%= Discourse.base_url %>">
|
||||
<img src="<%= logo_url %>" style="height: 35px"></a>
|
||||
<img src="<%= logo_url %>" style="max-height: 35px; min-height: 35px; height: 35px;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
site_link: site_link,
|
||||
last_seen_at: @last_seen_at) %>
|
||||
|
||||
<%- if @new_topics.present? %>
|
||||
<%- if @featured_topics.present? %>
|
||||
### <%=t 'user_notifications.digest.top_topics' %>
|
||||
|
||||
<%- @new_topics.each do |t| %>
|
||||
<%- @featured_topics.each do |t| %>
|
||||
<%= raw(@markdown_linker.create(t.title, t.relative_url)) %>
|
||||
|
||||
<%- if t.best_post.present? %>
|
||||
|
@ -22,6 +22,17 @@
|
|||
<%- end %>
|
||||
<%- end %>
|
||||
|
||||
<%- if @new_topics.present? %>
|
||||
**<%=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 %>
|
||||
<%- end -%>
|
||||
|
||||
<%- end -%>
|
||||
|
||||
|
||||
|
||||
<%= raw(@markdown_linker.references) %>
|
||||
|
||||
<%=raw(t :'user_notifications.digest.unsubscribe',
|
||||
|
|
|
@ -999,6 +999,7 @@ en:
|
|||
subject_template: "[%{site_name}] Forum Activity for %{date}"
|
||||
new_activity: "New activity on your topics and posts:"
|
||||
top_topics: "Recent posts the community enjoyed:"
|
||||
other_new_topics: "Other New Topics:"
|
||||
unsubscribe: "This summary email is sent as a courtesy notification from %{site_link} when we haven't seen you in a while.\nTo turn it off or change your email preferences, %{unsubscribe_link}."
|
||||
click_here: "click here"
|
||||
from: "%{site_name} digest"
|
||||
|
|
|
@ -53,6 +53,7 @@ module Email
|
|||
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;')
|
||||
style('div.digest-post h1', 'font-size: 20px;')
|
||||
|
||||
@fragment.css('pre').each do |pre|
|
||||
pre.replace(pre.text)
|
||||
|
|
Loading…
Reference in New Issue
Block a user