diff options
author | Lukas Matt <lukas@zauberstuhl.de> | 2014-03-21 18:48:48 +0400 |
---|---|---|
committer | Lukas Matt <lukas@zauberstuhl.de> | 2014-05-15 15:23:43 +0400 |
commit | 26d0c81dae88370b5efd1d10a813eb157eb580ab (patch) | |
tree | f0029c34843e30d268574f01b5fe495ad1e1d9c7 /app/mailers | |
parent | 719edcd1a7cb79827935fced10a922a037af3658 (diff) |
Added the ability to disable report-email-notification
Podmin can see a extra checkbox in Settings > Account
for disabling report-email-notification
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/report_mailer.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/mailers/report_mailer.rb b/app/mailers/report_mailer.rb index 70a4b6e53..a9223c752 100644 --- a/app/mailers/report_mailer.rb +++ b/app/mailers/report_mailer.rb @@ -9,8 +9,11 @@ class ReportMailer < ActionMailer::Base :id => id } Role.admins.each do |role| - resource[:email] = User.find_by_id(role.person_id).email - format(resource).deliver + user = User.find_by_id(role.person_id) + if !user.user_preferences.exists?(:email_type => :someone_reported) + resource[:email] = user.email + format(resource).deliver + end end end |