@ -7,6 +7,8 @@ class NotificationMailer < ApplicationMailer
@me = recipient
@me = recipient
@status = notification . target_status
@status = notification . target_status
return if @me . user . disabled?
locale_for_account ( @me ) do
locale_for_account ( @me ) do
thread_by_conversation ( @status . conversation )
thread_by_conversation ( @status . conversation )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.mention.subject' , name : @status . account . acct )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.mention.subject' , name : @status . account . acct )
@ -17,6 +19,8 @@ class NotificationMailer < ApplicationMailer
@me = recipient
@me = recipient
@account = notification . from_account
@account = notification . from_account
return if @me . user . disabled?
locale_for_account ( @me ) do
locale_for_account ( @me ) do
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.follow.subject' , name : @account . acct )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.follow.subject' , name : @account . acct )
end
end
@ -27,6 +31,8 @@ class NotificationMailer < ApplicationMailer
@account = notification . from_account
@account = notification . from_account
@status = notification . target_status
@status = notification . target_status
return if @me . user . disabled?
locale_for_account ( @me ) do
locale_for_account ( @me ) do
thread_by_conversation ( @status . conversation )
thread_by_conversation ( @status . conversation )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.favourite.subject' , name : @account . acct )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.favourite.subject' , name : @account . acct )
@ -38,6 +44,8 @@ class NotificationMailer < ApplicationMailer
@account = notification . from_account
@account = notification . from_account
@status = notification . target_status
@status = notification . target_status
return if @me . user . disabled?
locale_for_account ( @me ) do
locale_for_account ( @me ) do
thread_by_conversation ( @status . conversation )
thread_by_conversation ( @status . conversation )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.reblog.subject' , name : @account . acct )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.reblog.subject' , name : @account . acct )
@ -48,6 +56,8 @@ class NotificationMailer < ApplicationMailer
@me = recipient
@me = recipient
@account = notification . from_account
@account = notification . from_account
return if @me . user . disabled?
locale_for_account ( @me ) do
locale_for_account ( @me ) do
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.follow_request.subject' , name : @account . acct )
mail to : @me . user . email , subject : I18n . t ( 'notification_mailer.follow_request.subject' , name : @account . acct )
end
end
@ -59,15 +69,11 @@ class NotificationMailer < ApplicationMailer
@notifications = Notification . where ( account : @me , activity_type : 'Mention' ) . where ( 'created_at > ?' , @since )
@notifications = Notification . where ( account : @me , activity_type : 'Mention' ) . where ( 'created_at > ?' , @since )
@follows_since = Notification . where ( account : @me , activity_type : 'Follow' ) . where ( 'created_at > ?' , @since ) . count
@follows_since = Notification . where ( account : @me , activity_type : 'Follow' ) . where ( 'created_at > ?' , @since ) . count
return if @ notifications. empty?
return if @ me. user . disabled? || @ notifications. empty?
locale_for_account ( @me ) do
locale_for_account ( @me ) do
mail to : @me . user . email ,
mail to : @me . user . email ,
subject : I18n . t (
subject : I18n . t ( :subject , scope : [ :notification_mailer , :digest ] , count : @notifications . size )
:subject ,
scope : [ :notification_mailer , :digest ] ,
count : @notifications . size
)
end
end
end
end