From a53d828a734ee28fc02070cc03eb3b2669c328c9 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 25 Jun 2026 16:01:11 -0400 Subject: [PATCH] MAil Settings: Further UI Sprucing added more placeholder text field with only number input for ports etc --- admin/settings_mail.php | 48 +++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/admin/settings_mail.php b/admin/settings_mail.php index 806119ec..317c4c85 100644 --- a/admin/settings_mail.php +++ b/admin/settings_mail.php @@ -116,14 +116,14 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
- +
@@ -145,7 +145,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
Leave blank if no authentication is required.
@@ -153,7 +153,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
@@ -203,7 +203,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
@@ -233,7 +233,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
@@ -265,14 +265,14 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
- +
@@ -282,18 +282,18 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready;
- +
- +
- + Expires at:
@@ -327,29 +327,29 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; - + - + - + - + - + @@ -382,7 +382,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; - +
@@ -428,6 +428,11 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; function isStd(v) { return v === 'standard_imap' || v === 'standard_smtp'; } function isOauth(v) { return v === 'google_oauth' || v === 'microsoft_oauth'; } + // ---- Numeric-only inputs (ports): strip anything that isn't a digit ---- + document.querySelectorAll('.numeric-only').forEach(function (el) { + el.addEventListener('input', function () { this.value = this.value.replace(/[^0-9]/g, ''); }); + }); + // ---- Self-contained tab controller (no dependency on the BS tab plugin) ---- const navLinks = Array.from(document.querySelectorAll('#mailTabs .nav-link')); const panes = ['tab-smtp', 'tab-imap', 'tab-oauth', 'tab-from', 'tab-tests'] @@ -457,6 +462,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; const smtpHint = document.getElementById('smtp_provider_hint'); const smtpUserLb = document.getElementById('smtp_user_label'); const smtpUserHt = document.getElementById('smtp_user_hint'); + const smtpUserIn = document.getElementById('config_smtp_username'); const imapConn = document.getElementById('imap_conn_fields'); const imapUser = document.getElementById('imap_user_group'); @@ -470,6 +476,8 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; const tenantRow = document.getElementById('tenant_row'); const msConnect = document.getElementById('ms_connect_group'); const oauthHint = document.getElementById('oauth_hint'); + const oauthClientId = document.getElementById('config_mail_oauth_client_id'); + const oauthClientSecret = document.getElementById('config_mail_oauth_client_secret'); function render() { const sv = val(smtpSel), iv = val(imapSel); @@ -479,6 +487,7 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; toggle(smtpPass, isStd(sv)); show(smtpPtr, isOauth(sv)); if (smtpUserLb) smtpUserLb.textContent = isOauth(sv) ? 'Authenticated User Email (licensed user)' : 'SMTP Username'; + if (smtpUserIn) smtpUserIn.placeholder = isOauth(sv) ? 'licensed.user@yourcompany.com' : 'usually your full email address'; if (smtpUserHt) smtpUserHt.innerHTML = isOauth(sv) ? 'The licensed user that completed the OAuth flow — not the From / shared-mailbox address. Becomes the user= identity in the XOAUTH2 string.' : 'Leave blank if no authentication is required.'; @@ -502,12 +511,15 @@ $imap_ready = $imap_standard_ready || $imap_oauth_ready; show(oauthTabItem, anyOauth); toggle(tenantRow, anyMs); toggle(msConnect, anyMs); + if (oauthClientId) oauthClientId.placeholder = anyMs + ? 'Application (client) ID, e.g. 00000000-0000-0000-0000-000000000000' + : 'xxxxxxxxxxxx.apps.googleusercontent.com'; + if (oauthClientSecret) oauthClientSecret.placeholder = anyMs ? 'Entra client secret value' : 'Google client secret'; if (oauthHint) oauthHint.innerHTML = anyMs ? 'Microsoft 365: Client ID / Secret / Tenant from Entra ID; refresh token via the Connect button below.' : anyOauth ? 'Google Workspace: Client ID / Secret from Google Cloud; refresh token obtained via the consent flow.' : 'These credentials are shared by any Sending or Receiving provider set to Google / Microsoft OAuth.'; - // If OAuth tab is no longer relevant but is currently open, fall back to Sending. if (!anyOauth) { const oauthLink = document.querySelector('#mailTabs .nav-link[data-target="#tab-oauth"]'); if (oauthLink && oauthLink.classList.contains('active')) activateTab('#tab-smtp');
PurposePurpose From Email From Name
System Default
share links, system tasks
System Default
share links & system tasks
InvoicesInvoices
sent when emailing invoices
QuotesQuotes
sent when emailing quotes
TicketsTickets
ticket creation & client replies