FEATURE: reason to reject user signup (#11700)

Feature for `Must Approve Users` setup. When a user is rejected, a staff member can optionally set a reason for audit purposes. In addition, feedback email can be sent to the user.

Meta: https://meta.discourse.org/t/account-rejection-email/103112/8
This commit is contained in:
Krzysztof Kotlarek
2021-01-15 09:43:26 +11:00
committed by GitHub
parent add125aacf
commit 06b7c44593
18 changed files with 178 additions and 6 deletions

View File

@@ -37,6 +37,14 @@ class UserNotifications < ActionMailer::Base
new_user_tips: tips)
end
def signup_after_reject(user, opts = {})
locale = user_locale(user)
build_email(user.email,
template: 'user_notifications.signup_after_reject',
locale: locale,
reject_reason: opts[:reject_reason])
end
def suspicious_login(user, opts = {})
ipinfo = DiscourseIpInfo.get(opts[:client_ip])
location = ipinfo[:location]