From de67a4ac4a50cb84fc673cae74bd62474206bfc2 Mon Sep 17 00:00:00 2001 From: Remi <73385395+itsrubberduck@users.noreply.github.com> Date: Sat, 18 Oct 2025 16:33:06 +0200 Subject: [PATCH] Add reply-to support for admin notifications --- server/utils/notifications.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/utils/notifications.ts b/server/utils/notifications.ts index 67ded91..2583ef9 100644 --- a/server/utils/notifications.ts +++ b/server/utils/notifications.ts @@ -6,6 +6,7 @@ interface MailOptions { text?: string html?: string from?: string + replyTo?: string } interface MailPayload extends MailOptions { @@ -20,6 +21,7 @@ interface AdminNotificationInput { message?: string data?: NotificationDataEntry[] from?: string + replyTo?: string } interface SmtpConfig { @@ -83,6 +85,7 @@ async function sendViaSmtp(payload: MailPayload) { subject: payload.subject, text: payload.text, html: payload.html, + replyTo: payload.replyTo, }) return true } catch (error) { @@ -159,7 +162,7 @@ function formatAdminNotification(notification: AdminNotificationInput) { } } - return { subject, text: lines.join('\n'), from: notification.from } + return { subject, text: lines.join('\n'), from: notification.from, replyTo: notification.replyTo } } export async function sendAdminNotification(notification: string | AdminNotificationInput, text?: string) { @@ -171,7 +174,13 @@ export async function sendAdminNotification(notification: string | AdminNotifica mailOptions = { to, subject: notification, text: text || '' } } else { const formatted = formatAdminNotification(notification) - mailOptions = { to, subject: formatted.subject, text: formatted.text, from: formatted.from } + mailOptions = { + to, + subject: formatted.subject, + text: formatted.text, + from: formatted.from, + replyTo: formatted.replyTo, + } } const success = await sendMail(mailOptions)