0
0
Fork 0

Add preference to disable e-mails about new pending accounts (#10529)

This commit is contained in:
Eugen Rochko 2019-04-10 00:35:49 +02:00 committed by GitHub
parent 2cb16c20a6
commit 36b39fbac5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 2 deletions

View file

@ -191,6 +191,10 @@ class User < ApplicationRecord
settings.notification_emails['report']
end
def allows_pending_account_emails?
settings.notification_emails['pending_account']
end
def hides_network?
@hides_network ||= settings.hide_network
end
@ -295,7 +299,7 @@ class User < ApplicationRecord
def notify_staff_about_pending_account!
User.staff.includes(:account).each do |u|
next unless u.allows_report_emails?
next unless u.allows_pending_account_emails?
AdminMailer.new_pending_account(u.account, self).deliver_later
end
end