Remove digest e-mails (#17985)
* Remove digest e-mails * Remove digest-related code
This commit is contained in:
		
					parent
					
						
							
								5b0e8cc92b
							
						
					
				
			
			
				commit
				
					
						0b3e4fd5de
					
				
			
		
					 12 changed files with 1 additions and 214 deletions
				
			
		| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue