From 954a0118bae5770c74f1e811e03b8fc702c70db2 Mon Sep 17 00:00:00 2001 From: Paul Nothaft <53005142+the-luap@users.noreply.github.com> Date: Wed, 18 Mar 2026 10:49:45 +0100 Subject: [PATCH] fix: wrap test email with standard email template (#252) Use wrapEmailHtml() for the test email so it matches the look of all other emails sent by the platform (logo, footer, etc.). Co-authored-by: Paul Nothaft --- backend/src/routes/adminEmail.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/backend/src/routes/adminEmail.js b/backend/src/routes/adminEmail.js index f6944cb6..7f47f405 100644 --- a/backend/src/routes/adminEmail.js +++ b/backend/src/routes/adminEmail.js @@ -160,22 +160,26 @@ router.post('/test', adminAuth, requirePermission('email.send'), async (req, res const transporter = nodemailer.createTransport(transportConfig); - // Send test email + // Send test email with the same wrapper used for all other emails + const subject = 'Test Email - Photo Sharing Platform'; + const testHtmlBody = ` +

Test Email Successful!

+

This is a test email from your Photo Sharing platform.

+

If you're seeing this, your email configuration is working correctly.

+
+

+ Sent from: ${config.from_email}
+ SMTP Host: ${config.smtp_host}
+ Time: ${new Date().toISOString()} +

+ `; + const wrappedHtml = await wrapEmailHtml(testHtmlBody, subject); + await transporter.sendMail({ from: `${config.from_name} <${config.from_email}>`, to: test_email, - subject: 'Test Email - Photo Sharing Platform', - html: ` -

Test Email Successful!

-

This is a test email from your Photo Sharing platform.

-

If you're seeing this, your email configuration is working correctly.

-
-

- Sent from: ${config.from_email}
- SMTP Host: ${config.smtp_host}
- Time: ${new Date().toISOString()} -

- `, + subject, + html: wrappedHtml, text: 'Test Email Successful! Your email configuration is working correctly.' });