Mail review stage 5: a website form's email is answered at the visitor in its Reply-To, who becomes the ticket's CC under the client whose domain the site is on or none, and Reply-To at the sender's own domain is taken as the sender; someone who isn't a contact is answered without their subject or the ticket's link, and a forged ticket or one with no contact no longer emails the client's colleagues; a client's reply on a ticket nobody is assigned goes to the new-ticket address or the admins, and bounce and closed-ticket notices go to the assigned agent or the admins instead of every agent; an email with no From is from nobody rather than itflow-guest@example.com; a forged email no longer clears Email bounced; an address that is a contact at two clients goes to the one whose domain it is or where they last raised a ticket, with a note; an agent's emailed reply that went to the client is their public reply and the first response; 26.12.3 changelog

This commit is contained in:
johnnyq
2026-11-30 18:22:59 -05:00
parent 039c1b11da
commit e57faeeb3a
9 changed files with 422 additions and 126 deletions

View File

@@ -80,6 +80,26 @@ function appNotify($type, $details, $action = null, $client_id = 0, $entity_id =
}
}
/* appNotify() for the agents $user_ids only - $details SQL-escaped, as there. How many were told. */
function appNotifyUsers(array $user_ids, $type, $details, $action = '', $client_id = 0, $entity_id = 0) {
global $mysqli;
$type = logSqlText($type, 200);
$details = logSqlText($details, 1000);
$action = logSqlText((string) $action, 250);
$client_id = intval($client_id);
$entity_id = intval($entity_id);
$told = 0;
foreach (array_unique(array_map('intval', $user_ids)) as $user_id) {
if ($user_id > 0) {
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = '$type', notification = '$details', notification_action = '$action', notification_client_id = $client_id, notification_entity_id = $entity_id, notification_user_id = $user_id");
$told++;
}
}
return $told;
}
function logAudit($type, $action, $description, $client_id = 0, $entity_id = 0) {
global $mysqli, $session_user_agent, $session_ip, $session_user_id;