about summary refs log tree commit diff
path: root/app/mailers
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/notification_mailer.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb
index 1414c2295..6c81df269 100644
--- a/app/mailers/notification_mailer.rb
+++ b/app/mailers/notification_mailer.rb
@@ -1,11 +1,11 @@
 class NotificationMailer < ApplicationMailer
   helper StreamEntriesHelper
-  helper AtomBuilderHelper
 
   def mention(mentioned_account, status)
     @me     = mentioned_account
     @status = status
 
+    return unless @me.user.settings(:notification_emails).mention
     mail to: @me.user.email, subject: "You were mentioned by #{@status.account.acct}"
   end
 
@@ -13,6 +13,7 @@ class NotificationMailer < ApplicationMailer
     @me      = followed_account
     @account = follower
 
+    return unless @me.user.settings(:notification_emails).follow
     mail to: @me.user.email, subject: "#{@account.acct} is now following you"
   end
 
@@ -21,6 +22,7 @@ class NotificationMailer < ApplicationMailer
     @account = from_account
     @status  = target_status
 
+    return unless @me.user.settings(:notification_emails).favourite
     mail to: @me.user.email, subject: "#{@account.acct} favourited your status"
   end
 
@@ -29,6 +31,7 @@ class NotificationMailer < ApplicationMailer
     @account = from_account
     @status  = target_status
 
+    return unless @me.user.settings(:notification_emails).reblog
     mail to: @me.user.email, subject: "#{@account.acct} reblogged your status"
   end
 end