From ed4ea72f351277e8f3664a166409d6d47e5f65a3 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Mon, 5 Jan 2026 22:59:49 +0100 Subject: [PATCH] fix: add local error/success display for test email button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error and success messages were only shown at page top, not visible when scrolled to Email tab. Now shows feedback directly below button. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app/templates/admin/settings.html | 7 +++++++ static/admin/js/settings.js | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/templates/admin/settings.html b/app/templates/admin/settings.html index 7c9b33c9..6288a290 100644 --- a/app/templates/admin/settings.html +++ b/app/templates/admin/settings.html @@ -555,6 +555,13 @@ Sending... + +
+

+
+
+

+

Send a test email to verify the platform email configuration is working.

diff --git a/static/admin/js/settings.js b/static/admin/js/settings.js index e7190e49..f01cf059 100644 --- a/static/admin/js/settings.js +++ b/static/admin/js/settings.js @@ -78,6 +78,8 @@ function adminSettings() { emailEditMode: false, testEmailAddress: '', sendingTestEmail: false, + testEmailError: null, + testEmailSuccess: null, async init() { // Guard against multiple initialization @@ -464,13 +466,13 @@ function adminSettings() { async sendTestEmail() { if (!this.testEmailAddress) { - this.error = 'Please enter a test email address'; + this.testEmailError = 'Please enter a test email address'; return; } this.sendingTestEmail = true; - this.error = null; - this.successMessage = null; + this.testEmailError = null; + this.testEmailSuccess = null; try { const data = await apiClient.post('/admin/settings/email/test', { @@ -478,16 +480,16 @@ function adminSettings() { }); if (data.success) { - this.successMessage = `Test email sent to ${this.testEmailAddress}`; + this.testEmailSuccess = `Test email sent to ${this.testEmailAddress}`; setTimeout(() => { - this.successMessage = null; + this.testEmailSuccess = null; }, 5000); } else { - this.error = data.message || 'Failed to send test email'; + this.testEmailError = data.message || 'Failed to send test email'; } } catch (error) { settingsLog.error('Failed to send test email:', error); - this.error = error.message || 'Failed to send test email'; + this.testEmailError = error.message || 'Failed to send test email'; } finally { this.sendingTestEmail = false; }