diff --git a/devtest.php b/devtest.php deleted file mode 100644 index b78ca63..0000000 --- a/devtest.php +++ /dev/null @@ -1 +0,0 @@ -New file \ No newline at end of file diff --git a/newppr.php b/newppr.php index cf30719..88fc058 100644 --- a/newppr.php +++ b/newppr.php @@ -48,7 +48,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { function generatePprEmail($entryId) { - global $mailHost, $mailSMTPAuth, $mailUsername, $mailPassword, $mailPort, $baseUrl, $mailFromAddress, $mailFromName; + global $conn, $mailHost, $mailSMTPAuth, $mailUsername, $mailPassword, $mailPort, $baseUrl, $mailFromAddress, $mailFromName; $token = generateSecureToken($_POST['email'], $entryId); $secureLink = $baseUrl . "/pilotppr.php?op=view&token=" . urlencode($token); echo $secureLink; @@ -68,16 +68,20 @@ function generatePprEmail($entryId) { $mail->addAddress($_POST['email']); $mail->isHTML(true); - $mail->Subject = "PPR Confirmation"; + $mail->Subject = "PPR Confirmation for " . $_POST['ac_reg']; $mail->Body = "
This is to confirm we have received your PPR. To view or cancel your PPR please click the button:
- Edit Entry + View PPR "; $mail->send(); echo "Email sent successfully!"; + logJournal($conn, $entryId, "Confirm email sent"); + } catch (Exception $e) { echo "Email sending failed: {$mail->ErrorInfo}"; + logJournal($conn, $entryId, "Confirm email FAILED"); + } } diff --git a/pilotppr.php b/pilotppr.php index 37b51b5..d96229f 100644 --- a/pilotppr.php +++ b/pilotppr.php @@ -7,7 +7,7 @@ include("functions.php"); -