From 05f41d1798fc6b013a51943ebe118012f2ce7290 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 20 Jun 2023 19:37:42 -0400 Subject: [PATCH] Update email sent at field only if the email was sent --- cron_mail_queue.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cron_mail_queue.php b/cron_mail_queue.php index ff34d020..fc9dda8c 100644 --- a/cron_mail_queue.php +++ b/cron_mail_queue.php @@ -80,14 +80,12 @@ if (mysqli_num_rows($sql_queue) > 0) { if ($mail !== true) { mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $email_recipient_logging'"); mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Mail', log_action = 'Error', log_description = 'Failed to send email to $email_recipient_logging regarding $email_subject_logging. $mail'"); + } else { + // Update Message + mysqli_query($mysqli, "UPDATE email_queue SET email_sent_at = NOW() WHERE email_id = $email_id"); } - - } - - // Update Message - mysqli_query($mysqli, "UPDATE email_queue SET email_sent_at = NOW() WHERE email_id = $email_id"); + } } - } /*