Unprocessed Email - email the ticket mailbox took but couldn't make a ticket from (functions/mail_unprocessed.php), * and any kept before strangers' email was left in the inbox again. Each can * be opened, made a ticket, added to a ticket, tried again or dismissed (agent/post/email_unprocessed.php); the first * three are done by the email parser within a minute. The pills pick To sort, Sorted and Dismissed. */ // Default Column Sortby Filter $sort = "email_unprocessed_received_at"; $order = "DESC"; require_once "includes/inc_all.php"; enforceUserPermission('module_support'); $page_title = 'Unprocessed Email'; $can_edit = lookupUserPermission('module_support') >= 2; if (!mailUnprocessedReady()) { echo '
This list arrives with the 4.3.2 database update - Maintenance > Update.
'; require_once "../includes/footer.php"; exit; } $tabs = [ 'waiting' => ['To sort', 'fa-inbox', "email_unprocessed_done_at IS NULL"], 'sorted' => ['Sorted', 'fa-check', "email_unprocessed_done_at IS NOT NULL AND email_unprocessed_action <> 'dismiss'"], 'dismissed' => ['Dismissed', 'fa-times', "email_unprocessed_action = 'dismiss'"], ]; $show = (string) ($_GET['show'] ?? 'waiting'); $show = isset($tabs[$show]) ? $show : 'waiting'; // Only these sort - an unknown column would take the page down $sortable_columns = [ 'email_unprocessed_received_at' => "email_unprocessed_received_at $order", 'email_unprocessed_from_email' => "email_unprocessed_from_email $order, email_unprocessed_received_at DESC", 'email_unprocessed_subject' => "email_unprocessed_subject $order, email_unprocessed_received_at DESC", ]; if (!isset($sortable_columns[$sort])) { $sort = 'email_unprocessed_received_at'; } $search = "(email_unprocessed_from_email LIKE '%$q%' OR email_unprocessed_from_name LIKE '%$q%' OR email_unprocessed_subject LIKE '%$q%' OR email_unprocessed_preview LIKE '%$q%' OR email_unprocessed_reason LIKE '%$q%')"; $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS email_unprocessed.*, ticket_prefix, ticket_number, ticket_client_id, user_name AS asked_by FROM email_unprocessed LEFT JOIN tickets ON ticket_id = email_unprocessed_ticket_id LEFT JOIN users ON user_id = email_unprocessed_action_by WHERE $search AND {$tabs[$show][2]} ORDER BY {$sortable_columns[$sort]}, email_unprocessed_id DESC LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); // How many in each tab, as searched $count_sql = []; foreach ($tabs as $key => [, , $where]) { $count_sql[] = "COALESCE(SUM($where), 0)"; } $counts = array_combine(array_keys($tabs), array_map('intval', mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', $count_sql) . " FROM email_unprocessed WHERE $search")))); $pill_url = function ($show) { return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $show])); }; $csrf = $_SESSION['csrf_token']; ?>

Unprocessed Email

Email the ticket mailbox took but couldn't make a ticket from. A ticket made here, or a reply added, is made by the email parser within a minute. Sorted and dismissed email is kept days.
"> (no subject)'; $from_name = trim((string) $row['email_unprocessed_from_name']); $from_email = (string) $row['email_unprocessed_from_email']; $view = 'data-modal-size="lg" data-modal-url="modals/email_unprocessed/email_unprocessed_view.php?id=' . $id . '"'; $waiting = $state['key'] === 'waiting'; ?>
' . escapeHtml($from_email) . '' : ($from_email !== '' ? escapeHtml($from_email) : 'No sender address') ?>
by
>
'emails', 'views' => ['show'], 'icon' => 'fa-envelope-open-text', 'title' => ['waiting' => 'Nothing to sort', 'sorted' => 'Nothing sorted lately', 'dismissed' => 'Nothing dismissed lately'][$show], 'text' => 'Email the ticket mailbox took but couldn\'t make a ticket from waits here. Email from someone who isn\'t a contact, at a domain no client has, stays in the mailbox\'s inbox, flagged - unless tickets from unknown senders are on.', ]; ?>