Contact alternate email (DB 4.4.1): one more address per contact in the contact window under Email, shown on their page, quick look and the Reach column, searched by the contacts, clients, tickets and global searches, exported and imported as Alternate Email and in the API as contact_email_alt, and recognized on incoming email as theirs - a new ticket as them at their client even with unknown senders off, and their reply by ticket number, conversation or subject - with the ticket's from line showing the address it came from while everything ITFlow sends still goes to their Email and neither address is copied in; the duplicate warning, Try an Email, Unprocessed Email and the ignored sender and routing rule warnings count it too, and the same-as-Email warning shows while typing (contactEmailSql(), contactHasEmail(), contactEmailMatchSql()); 26.12.4 changelog

This commit is contained in:
johnnyq
2026-12-02 13:36:49 -05:00
parent 8dae372d57
commit 2ad57e2865
31 changed files with 276 additions and 80 deletions

View File

@@ -153,7 +153,7 @@ if ($invites_view) {
}
} else {
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS contacts.contact_id, contact_archived_at, contact_billing, contact_client_id,
contact_department, contact_email, " . contactBounceColumns() . ", " . contactUnsubscribeColumns() . ", contact_extension, contact_important, contact_location_id, contact_mobile,
contact_department, contact_email, " . contactEmailAltColumn() . ", " . contactBounceColumns() . ", " . contactUnsubscribeColumns() . ", contact_extension, contact_important, contact_location_id, contact_mobile,
contact_mobile_country_code, contact_name, contact_phone, contact_phone_country_code, contact_photo, contact_primary,
contact_technical, contact_title, contact_user_id, client_id, client_name, location_archived_at, location_name, user_auth_method
FROM contacts
@@ -163,7 +163,7 @@ if ($invites_view) {
WHERE $archive_query
$tag_query
AND ($role_query)
AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%'
AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%'" . contactEmailAltLikeSql($q) . " OR contact_department LIKE '%$q%'
OR contact_phone LIKE '%$phone_query%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$phone_query%' OR client_name LIKE '%$q%'
OR contacts.contact_id IN (SELECT contact_tags.contact_id FROM contact_tags JOIN tags ON tags.tag_id = contact_tags.tag_id WHERE tag_name LIKE '%$q%'))
" . clientScopeSql('contact_client_id') . "
@@ -583,6 +583,7 @@ $search_title = $invites_view ? 'Email, name or client' : 'Name, title, email, p
$contact_title = escapeHtml($row['contact_title']);
$contact_department = escapeHtml($row['contact_department']);
$contact_email = escapeHtml($row['contact_email']);
$contact_email_alt = escapeHtml($row['contact_email_alt'] ?? '');
$contact_phone_link = contactPhoneLink($row['contact_phone'], $row['contact_phone_country_code'], $row['contact_extension'], 'text-reset');
$contact_mobile_link = contactPhoneLink($row['contact_mobile'], $row['contact_mobile_country_code'], '', 'text-reset');
$contact_primary = intval($row['contact_primary']);
@@ -633,7 +634,10 @@ $search_title = $invites_view ? 'Email, name or client' : 'Name, title, email, p
<?php if ($contact_email) { ?>
<div class="text-nowrap"><i class="far fa-fw fa-envelope text-body-secondary me-1" title="Email"></i><a class="text-reset" href="mailto:<?= $contact_email ?>"><?= $contact_email ?></a><button type="button" class="itflow-copy clipboardjs" title="Copy email" data-clipboard-text="<?= $contact_email ?>"><i class="far fa-copy"></i></button> <?= contactBounceBadge($row) ?> <?= contactUnsubscribeBadge($row) ?></div>
<?php } ?>
<?php if (!$contact_phone_link && !$contact_mobile_link && !$contact_email) { ?>
<?php if ($contact_email_alt) { ?>
<div class="text-nowrap" data-contact-email-alt><i class="fas fa-fw fa-at text-body-secondary me-1" title="Alternate email"></i><a class="text-reset" href="mailto:<?= $contact_email_alt ?>"><?= $contact_email_alt ?></a><button type="button" class="itflow-copy clipboardjs" title="Copy alternate email" data-clipboard-text="<?= $contact_email_alt ?>"><i class="far fa-copy"></i></button></div>
<?php } ?>
<?php if (!$contact_phone_link && !$contact_mobile_link && !$contact_email && !$contact_email_alt) { ?>
<span class="text-body-secondary">-</span>
<?php } ?>
</td>