Mail queue keeps what a sent email said: only an email with a link or code that opens something - a shared login and its code, a portal or agent invite, a password link, a contract to sign or a task to approve - is cleared once sent, and a day after it was queued if it failed or was cancelled; emailQueue gains a sensitive option set by those senders, cron marks sent email with mailQueueSentSql, nightly runs mailQueueClearSensitive, and a cleared email can't be retried; database 3.7.1 adds email_queue.email_sensitive and marks email waiting at the update; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-16 18:48:57 -05:00
parent 8784c50abe
commit c2eb55c8dc
17 changed files with 107 additions and 30 deletions

View File

@@ -849,8 +849,10 @@ function addToMailQueue($data) {
// The ticket reply it carries (emailQueue()'s ticket_reply_id), once the 3.4.8 update has made the column
$ticket_reply_sql = !empty($email['ticket_reply_id']) ? ', email_ticket_reply_id = ' . intval($email['ticket_reply_id']) : '';
// One with a link or code that opens something, cleared once it has gone (emailQueue()'s sensitive) - once the 3.7.1 update has made the column
$sensitive_sql = !empty($email['sensitive']) && mailQueueHasSensitive() ? ', email_sensitive = 1' : '';
mysqli_query($mysqli, "INSERT INTO email_queue SET email_recipient = '$recipient', email_recipient_name = '$recipient_name', email_from = '$from', email_from_name = '$from_name', email_subject = '$subject', email_content = '$body', email_queued_at = $queued_at, email_cal_str = '$cal_str', email_attachments = '$attachments'$ticket_reply_sql");
mysqli_query($mysqli, "INSERT INTO email_queue SET email_recipient = '$recipient', email_recipient_name = '$recipient_name', email_from = '$from', email_from_name = '$from_name', email_subject = '$subject', email_content = '$body', email_queued_at = $queued_at, email_cal_str = '$cal_str', email_attachments = '$attachments'$ticket_reply_sql$sensitive_sql");
}
return true;