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

@@ -12,6 +12,7 @@ if (isset($_POST['send_bulk_mail_now'])) {
$mail_from_name = sanitizeInput($_POST['mail_from_name']);
$subject = sanitizeInput($_POST['subject']);
$body = mysqli_escape_string($mysqli, $_POST['body']);
$queued_at = sanitizeInput($_POST['queued_at']);
// Add Emails
foreach($_POST['contact'] as $contact_id) {
@@ -30,7 +31,8 @@ if (isset($_POST['send_bulk_mail_now'])) {
'recipient' => $contact_email,
'recipient_name' => $contact_name,
'subject' => $subject,
'body' => $body
'body' => $body,
'queued_at' => $queued_at
];
}
addToMailQueue($mysqli, $data);