fix(mail): robust recipient logic and sentry dsn verification
All checks were successful
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 5s
🚀 Build & Deploy / 🧪 QA (push) Successful in 2m18s
🚀 Build & Deploy / 🏗️ Build (push) Successful in 12m3s
🚀 Build & Deploy / 🚀 Deploy (push) Successful in 14s
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 3m58s
🚀 Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-04-13 11:49:09 +02:00
parent f03e417eb7
commit bf1dfe4015
2 changed files with 14 additions and 4 deletions

View File

@@ -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

View File

@@ -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,