From e2116fa9dbfddef171e58becff3b9ae139afe128 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 10 Oct 2006 05:53:43 +0000 Subject: [PATCH] r1237: Send an email when we activate a user --- admin/usergroup.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/admin/usergroup.php b/admin/usergroup.php index 22b7930..ea3349d 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -306,7 +306,25 @@ if ($_POST['do'] == 'doapprove') if (sizeof($idlist) > 0) { - // TODO - maybe send some kind of email? + $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid IN (" . implode(',', $idlist) . ")"); + + $mail->set('subject', sprintf(_('Account Approved at %1$s'), $bugsys->options['trackertitle'])); + while ($user = $db->fetch_array($users)) + { + $mail->to = array(); + $mail->to_add($user['displayname'], $user['email']); + $mail->set('bodytext', sprintf(_('Hi %1$s, + +Your account was awaiting moderation at %2$s. Today, an administrator approved your registration and you are now able to use the bug tracker fully. + +If you have any questions, please don\'t hesitate to contact the webmaster.'), + $user['displayname'], + $bugsys->options['trackertitle'] + )); + + $mail->send(); + } + $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE userid IN (" . implode(',', $idlist) . ")"); } -- 2.22.5