General tidy
This commit is contained in:
10
newppr.php
10
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 = "
|
||||
<p>This is to confirm we have received your PPR. To view or cancel your PPR please click the button:</p>
|
||||
<a href='$secureLink' style='display: inline-block; padding: 10px 20px; color: white; background-color: #007bff; text-decoration: none; border-radius: 5px;'>Edit Entry</a>
|
||||
<a href='$secureLink' style='display: inline-block; padding: 10px 20px; color: white; background-color: #007bff; text-decoration: none; border-radius: 5px;'>View PPR</a>
|
||||
";
|
||||
|
||||
$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");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user