fix(mail): harden mailer and fix missing notification recipients
Some checks failed
Build & Deploy / 🧪 QA (push) Failing after 1m24s
Build & Deploy / 🔍 Prepare (push) Successful in 16s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 4s

This commit is contained in:
2026-04-10 12:58:04 +02:00
parent 1a5dfc96c1
commit 18556c818d
4 changed files with 53 additions and 14 deletions

View File

@@ -95,6 +95,7 @@ export async function sendContactFormAction(formData: FormData) {
);
if (!isTestSubmission) {
logger.info('Sending internal notification', { recipients: config.mail.recipients });
const notificationResult = await sendEmail({
replyTo: email,
subject: notificationSubject,
@@ -106,14 +107,18 @@ export async function sendContactFormAction(formData: FormData) {
messageId: notificationResult.messageId,
});
} else {
logger.error('Notification email FAILED', {
logger.error('Notification email DELIVERY FAILED', {
error: notificationResult.error,
subject: notificationSubject,
email,
recipients: config.mail.recipients,
});
services.errors.captureException(
new Error(`Notification email failed: ${notificationResult.error}`),
{ action: 'sendContactFormAction_notification', email },
{
action: 'sendContactFormAction_notification',
email,
recipients: config.mail.recipients
},
);
}
} else {
@@ -130,6 +135,7 @@ export async function sendContactFormAction(formData: FormData) {
);
if (!isTestSubmission) {
logger.info('Sending customer confirmation', { to: email });
const confirmationResult = await sendEmail({
to: email,
subject: confirmationSubject,
@@ -141,7 +147,7 @@ export async function sendContactFormAction(formData: FormData) {
messageId: confirmationResult.messageId,
});
} else {
logger.error('Confirmation email FAILED', {
logger.error('Confirmation email DELIVERY FAILED', {
error: confirmationResult.error,
subject: confirmationSubject,
to: email,