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.' });