From 06016453bd91882a53e91c11fc80f2c75fd474bb Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 7 Oct 2016 13:17:56 +0200 Subject: Adding user settings (model and mailer), no form yet --- app/mailers/notification_mailer.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/mailers') 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 -- cgit