Remove digest e-mails (#17985)

* Remove digest e-mails

* Remove digest-related code
This commit is contained in:
Eugen Rochko
2022-08-25 23:38:22 +02:00
committed by GitHub
parent 5b0e8cc92b
commit 0b3e4fd5de
12 changed files with 1 additions and 214 deletions

View File

@ -66,24 +66,6 @@ class NotificationMailer < ApplicationMailer
end
end
def digest(recipient, **opts)
return unless recipient.user.functional?
@me = recipient
@since = opts[:since] || [@me.user.last_emailed_at, (@me.user.current_sign_in_at + 1.day)].compact.max
@notifications_count = Notification.where(account: @me, activity_type: 'Mention').where('created_at > ?', @since).count
return if @notifications_count.zero?
@notifications = Notification.where(account: @me, activity_type: 'Mention').where('created_at > ?', @since).limit(40)
@follows_since = Notification.where(account: @me, activity_type: 'Follow').where('created_at > ?', @since).count
locale_for_account(@me) do
mail to: @me.user.email,
subject: I18n.t(:subject, scope: [:notification_mailer, :digest], count: @notifications_count)
end
end
private
def thread_by_conversation(conversation)