Mail Queue - one email: where it stands, and why it last * failed or who cancelled it; who it is to and from; when it was queued, * tried, sent or given up on; its attachments and calendar file; and what it * says, until it is sent - that is cleared then (cron/mail_queue.php). The * email is shown as it will arrive, in a sandboxed frame that runs nothing * and can't reach this page. Retry now, Cancel and Delete as on its row * (admin/post/mail_queue.php). */ require_once '../../includes/modal_header.php'; $email_id = intval($_GET['id'] ?? 0); $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT email_id, email_status, email_attempts, email_from, email_from_name, email_recipient, email_recipient_name, email_subject, email_content, email_cal_str, email_attachments, email_queued_at, email_failed_at, email_sent_at, " . mailQueueErrorColumn() . " FROM email_queue WHERE email_id = $email_id LIMIT 1")); ob_start(); if (!$row) { ?> no address'; } if ($name === '' || strcasecmp($name, $address) === 0) { return escapeHtml($address); } return escapeHtml($name) . ' <' . escapeHtml($address) . '>'; }; $attachments = []; foreach ((array) json_decode((string) $row['email_attachments'], true) as $attachment) { if (is_array($attachment) && trim((string) ($attachment['name'] ?? '')) !== '') { $attachments[] = basename((string) $attachment['name']); } } $has_invite = trim((string) $row['email_cal_str']) !== ''; $content = (string) $row['email_content']; $subject = trim((string) $row['email_subject']) !== '' ? escapeHtml($row['email_subject']) : '(no subject)'; // How many tries, in words if ($tries > MAIL_QUEUE_TRIES) { $tries_text = 'Not tried again'; } elseif ($status === 3) { $tries_text = $tries > 1 ? "Went on try $tries" : 'Went first time'; } elseif ($tries > 0) { $tries_text = "$tries of " . MAIL_QUEUE_TRIES; } else { $tries_text = 'Not tried yet'; } ?>