about summary refs log tree commit diff
path: root/app/views/notification_mailer
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-02 10:47:32 +0100
committerGitHub <noreply@github.com>2019-01-02 10:47:32 +0100
commit66436d08959998be20c6c6bf631177d8c1f3e0d1 (patch)
treee9d8fd6b53006cbf2c12418a9ebfa6e46a1be617 /app/views/notification_mailer
parentdc84899fffbee254454e88f3d78848eb6c51beeb (diff)
Improve e-mail digest (#9689)
- Reduce time-to-digest from 20 to 7 days
- Fetch mentions starting from +1 day since last login
- Fix case when last login is more recent than last e-mail
- Do not render all mentions, only 40, but show number in subject
- Do not send digest to moved accounts
- Do send digest to silenced accounts
Diffstat (limited to 'app/views/notification_mailer')
-rw-r--r--app/views/notification_mailer/digest.html.haml2
-rw-r--r--app/views/notification_mailer/digest.text.erb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/notification_mailer/digest.html.haml b/app/views/notification_mailer/digest.html.haml
index 10e44f8dd..a94ace228 100644
--- a/app/views/notification_mailer/digest.html.haml
+++ b/app/views/notification_mailer/digest.html.haml
@@ -14,7 +14,7 @@
                           %tr
                             %td.column-cell.text-center.padded
                               %h1= t 'notification_mailer.digest.title'
-                              %p.lead= t('notification_mailer.digest.body', since: l(@since.to_date, format: :short), instance: site_hostname)
+                              %p.lead= t('notification_mailer.digest.body', since: l((@me.user_current_sign_in_at || @since).to_date, format: :short), instance: site_hostname)
                               %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 }
                                 %tbody
                                   %tr
diff --git a/app/views/notification_mailer/digest.text.erb b/app/views/notification_mailer/digest.text.erb
index e0d1f9b8b..b2c85a9e3 100644
--- a/app/views/notification_mailer/digest.text.erb
+++ b/app/views/notification_mailer/digest.text.erb
@@ -1,6 +1,6 @@
 <%= raw t('application_mailer.salutation', name: display_name(@me)) %>
 
-<%= raw t('notification_mailer.digest.body', since: l(@since), instance: root_url) %>
+<%= raw t('notification_mailer.digest.body', since: l(@me.user_current_sign_in_at || @since), instance: root_url) %>
 <% @notifications.each do |notification| %>
 
 * <%= raw t('notification_mailer.digest.mention', name: notification.from_account.acct) %>