From 89f8cb7b48e57be6e4ad85fe17cfebe73eb32653 Mon Sep 17 00:00:00 2001 From: arf20 Date: Wed, 20 Mar 2024 16:10:53 +0100 Subject: Send notification emails --- verify.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'verify.php') diff --git a/verify.php b/verify.php index 5382f4f..2e4a26a 100644 --- a/verify.php +++ b/verify.php @@ -1,4 +1,25 @@ fetch_all(MYSQLI_ASSOC); + + foreach ($admins as $admin) { + $mailer->addAddress($admin["email"]); + } + + $mailer->Subject = "New user registered"; + $mailer->Body = "Admins,\n\nUser $username verified." + ."\n\n--\nARFNET Client, Service, Ticket and Invoice Management System\nhttps://arf20.com"; + if (!$mailer->send()) { + echo 'Mailer Error [ask arf20]: ' . $mailer->ErrorInfo; + }; +} + // Initialize the session session_start(); @@ -54,6 +75,7 @@ if ($_SERVER["REQUEST_METHOD"] == "GET") { $param_id = $id; if (mysqli_stmt_execute($stmt) && mysqli_stmt_affected_rows($stmt) == 1) { $verification_success = true; + send_verify_notification($username); } else { echo "SQL error, ask arf20."; } -- cgit v1.2.3