Allow to set an optional queue time in bulk mail, update cron_mail_queue.php to only send mail after its queued_at date and time

This commit is contained in:
johnnyq
2024-01-21 15:52:15 -05:00
parent 62fb73875b
commit ad1ec7d338
4 changed files with 15 additions and 4 deletions

View File

@@ -938,8 +938,8 @@ function addToMailQueue($mysqli, $data) {
$body = strval($email['body']);
// Check if 'email_queued_at' is set and not empty
if (isset($email['email_queued_at']) && !empty($email['email_queued_at'])) {
$queued_at = $email['email_queued_at'];
if (isset($email['queued_at']) && !empty($email['queued_at'])) {
$queued_at = $email['queued_at'];
} else {
// Use the current date and time if 'email_queued_at' is not set or empty
$queued_at = date('Y-m-d H:i:s');