diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 79c491f..00f4670 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -280,6 +280,7 @@ jobs: GATEKEEPER_ORIGIN="$NEXT_PUBLIC_BASE_URL/gatekeeper" # Generate Environment File + echo "🔍 Verifying Sentry DSN: ${SENTRY_DSN:0:12}... (masked)" cat > .env.deploy << EOF # Generated by CI - $TARGET IMAGE_TAG=$IMAGE_TAG diff --git a/app/api/contact/route.ts b/app/api/contact/route.ts index 0fe0612..95e8331 100644 --- a/app/api/contact/route.ts +++ b/app/api/contact/route.ts @@ -82,6 +82,18 @@ export async function POST(req: Request) { const { config } = await import("@/lib/config"); const clientName = "MB Grid Solutions"; + // Robust recipient resolution + const recipients = Array.isArray(config.mail.recipients) + ? config.mail.recipients.filter(Boolean) + : []; + + const to = + recipients.length > 0 + ? recipients.join(",") + : process.env.CONTACT_RECIPIENT || "info@mb-grid-solutions.com"; + + logger.info("Preparing to send notification email", { to }); + // 2a. Notification to MB Grid const notificationHtml = await render( React.createElement(ContactFormNotification, { @@ -94,10 +106,7 @@ export async function POST(req: Request) { await payload.sendEmail({ from: config.mail.from, - to: - config.mail.recipients.join(",") || - process.env.CONTACT_RECIPIENT || - "info@mb-grid-solutions.com", + to, replyTo: email, subject: `Kontaktanfrage von ${name}`, html: notificationHtml,