mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
Rename watchers to CCs in the database and code: database 4.2.8 renames ticket_watchers to ticket_ccs with its columns and index, functions, settings, form and post names, the Add CC modal file, JavaScript IDs, the email preview key and the To line group follow; the ticket email parser waits while a database update is pending instead of flagging email it cannot take; 26.12.3 changelog updated
This commit is contained in:
@@ -45,8 +45,8 @@ function ticketEmailSubject(array $row) {
|
||||
}
|
||||
|
||||
/*
|
||||
* The ticket settings for its emails, read once - copy: one email, the watchers copied in (else
|
||||
* one each); relay: a client's reply goes on to the watchers who didn't have it. Both on until
|
||||
* The ticket settings for its emails, read once - copy: one email, the CCs copied in (else
|
||||
* one each); relay: a client's reply goes on to the CCs who didn't have it. Both on until
|
||||
* the 4.2.6 update has made them, as they are by default after it.
|
||||
*/
|
||||
function ticketMailSettings() {
|
||||
@@ -227,18 +227,18 @@ function ticketMailSubjectTicket($subject) {
|
||||
|
||||
/*
|
||||
* The people an email to a ticket was also to or copied to ($addresses, its To and Cc) made the
|
||||
* ticket's watchers, so the rest of the conversation reaches them as it reaches whoever wrote it.
|
||||
* ticket's CCs, so the rest of the conversation reaches them as it reaches whoever wrote it.
|
||||
* Never whoever sent it ($sender), the ticket's contact, an agent, one of ITFlow's own addresses or
|
||||
* another address at your own domain (emailOwnDomain()), nor a no-reply address. The ones added.
|
||||
*/
|
||||
function ticketMailCopiedWatchers($ticket_id, array $addresses, $sender) {
|
||||
function ticketMailCopiedCcs($ticket_id, array $addresses, $sender) {
|
||||
global $mysqli;
|
||||
$ticket_id = intval($ticket_id);
|
||||
$contact_email = strtolower(trim((string) (mysqli_fetch_row(mysqli_query($mysqli, "SELECT contact_email FROM tickets
|
||||
JOIN contacts ON contact_id = ticket_contact_id WHERE ticket_id = $ticket_id"))[0] ?? '')));
|
||||
$sender = strtolower(trim((string) $sender));
|
||||
$emails = [];
|
||||
foreach (ticketWatcherEmails($addresses) as $email) {
|
||||
foreach (ticketCcEmails($addresses) as $email) {
|
||||
if ($email === $sender || $email === $contact_email || emailOwnAddress($email) || emailOwnDomain($email)
|
||||
|| preg_match('/do[\W_]*not[\W_]*reply|no[\W_]*reply/i', $email)) {
|
||||
continue;
|
||||
@@ -248,7 +248,7 @@ function ticketMailCopiedWatchers($ticket_id, array $addresses, $sender) {
|
||||
}
|
||||
$emails[] = $email;
|
||||
}
|
||||
return ticketAddWatchers($ticket_id, array_slice($emails, 0, 20));
|
||||
return ticketAddCcs($ticket_id, array_slice($emails, 0, 20));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user