Email Routing - email routing rules (functions/mail_route.php): an address or a domain, with words its subject * has, whose new tickets by email go to a client and a contact, with a category, a priority, an agent and a ticket * template. Each with why, who added it, and how many emails it routed and the last. New and edit in * modals/email_routing_rule/email_routing_rule.php; the handlers are admin/post/email_routing_rule.php. */ // Default Column Sortby Filter $sort = "routing_rule_match"; $order = "ASC"; require_once "includes/inc_all_admin.php"; if (!mailRouteReady()) { ?>
Email routing needs the database update - Maintenance > Update.
"routing_rule_match $order, routing_rule_subject ASC", 'client_name' => "client_name IS NULL, client_name $order, routing_rule_match ASC", 'routing_rule_matches' => "routing_rule_matches $order, routing_rule_match ASC", 'routing_rule_matched_at' => "routing_rule_matched_at IS NULL, routing_rule_matched_at $order, routing_rule_match ASC", 'routing_rule_created_at' => "routing_rule_created_at $order, routing_rule_match ASC", ]; if (!isset($sortable_columns[$sort])) { $sort = 'routing_rule_match'; } $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS email_routing_rules.*, client_name, client_archived_at, contact_name, contact_archived_at, contact_client_id, category_name, category_archived_at, agent.user_name AS agent_name, agent.user_status AS agent_status, agent.user_archived_at AS agent_archived_at, ticket_template_name, ticket_template_archived_at, creator.user_name AS creator_name FROM email_routing_rules LEFT JOIN clients ON client_id = routing_rule_client_id LEFT JOIN contacts ON contact_id = routing_rule_contact_id LEFT JOIN categories ON category_id = routing_rule_category_id LEFT JOIN users agent ON agent.user_id = routing_rule_assigned_to LEFT JOIN ticket_templates ON ticket_template_id = routing_rule_ticket_template_id LEFT JOIN users creator ON creator.user_id = routing_rule_created_by WHERE (routing_rule_match LIKE '%$q%' OR routing_rule_subject LIKE '%$q%' OR routing_rule_note LIKE '%$q%' OR client_name LIKE '%$q%' OR contact_name LIKE '%$q%' OR category_name LIKE '%$q%' OR agent.user_name LIKE '%$q%' OR ticket_template_name LIKE '%$q%') ORDER BY {$sortable_columns[$sort]} LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?>

Email Routing

A new ticket by email from these addresses and domains goes where the rule says - to its client, over the sender's own contact or domain, with its category, priority, agent and template. Replies to a ticket still go on it, and Ignored Senders are set aside first. The sender is answered and copied in only when they are the ticket's contact. When more than one rule takes an email, the most exact routes it: an address before a domain, and a rule with subject words before one without. Try an Email shows what one would do.

"> ' . escapeHtml($row['category_name']) . ''; } else { $gone[] = 'Category archived or deleted'; } } if ((string) $row['routing_rule_priority'] !== '') { $sets[] = '' . escapeHtml($row['routing_rule_priority']) . ''; } if (intval($row['routing_rule_assigned_to'])) { if ($row['agent_name'] !== null && intval($row['agent_status']) === 1 && $row['agent_archived_at'] === null) { $sets[] = '' . escapeHtml($row['agent_name']) . ''; } else { $gone[] = 'Agent disabled or archived'; } } if (intval($row['routing_rule_ticket_template_id'])) { if ($row['ticket_template_name'] !== null && $row['ticket_template_archived_at'] === null) { $sets[] = '' . escapeHtml($row['ticket_template_name']) . ''; } else { $gone[] = 'Template archived or deleted'; } } ?>
Sets
>
, with “” in the subject
Whoever it's from
-' ?>
- skipped until it's fixed
ticket
'routing rules', 'icon' => 'fa-route', 'text' => 'Send the new tickets from an address or a domain to a client, with a category, priority, agent or template - a vendor\'s alerts about one client, a monitoring system, a form.', 'actions' => [['label' => 'New Routing Rule', 'modal' => 'modals/email_routing_rule/email_routing_rule.php', 'size' => 'lg']], ]; require_once "../includes/filter_footer.php"; ?>