From 985424bafdf2c3427be5026e0bc011e49d8c454c Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Tue, 14 May 2024 12:43:29 -0600 Subject: [PATCH] Send account approval notification when approved from profile action Signed-off-by: Jon Stovell --- Sources/Actions/Profile/Activate.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sources/Actions/Profile/Activate.php b/Sources/Actions/Profile/Activate.php index 2a8b58947e..f71d98edf8 100644 --- a/Sources/Actions/Profile/Activate.php +++ b/Sources/Actions/Profile/Activate.php @@ -88,6 +88,20 @@ public function execute(): void ]); } + // Inform the user that their account has been approved. + if (in_array($prev_is_activated, [User::UNAPPROVED, User::NEED_COPPA])) { + $replacements = [ + 'NAME' => Profile::$member->name, + 'USERNAME' => Profile::$member->username, + 'PROFILELINK' => Config::$scripturl . '?action=profile;u=' . Profile::$member->id, + 'FORGOTPASSWORDLINK' => Config::$scripturl . '?action=reminder', + ]; + + $emaildata = Mail::loadEmailTemplate('admin_approve_accept', $replacements, Profile::$member->language); + + Mail::send(Profile::$member->email, $emaildata['subject'], $emaildata['body'], null, 'accapp' . Profile::$member->id, $emaildata['is_html'], 0); + } + // Make sure we update the stats too. Logging::updateStats('member', false); }