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
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:
@@ -280,6 +280,7 @@ jobs:
|
|||||||
GATEKEEPER_ORIGIN="$NEXT_PUBLIC_BASE_URL/gatekeeper"
|
GATEKEEPER_ORIGIN="$NEXT_PUBLIC_BASE_URL/gatekeeper"
|
||||||
|
|
||||||
# Generate Environment File
|
# Generate Environment File
|
||||||
|
echo "🔍 Verifying Sentry DSN: ${SENTRY_DSN:0:12}... (masked)"
|
||||||
cat > .env.deploy << EOF
|
cat > .env.deploy << EOF
|
||||||
# Generated by CI - $TARGET
|
# Generated by CI - $TARGET
|
||||||
IMAGE_TAG=$IMAGE_TAG
|
IMAGE_TAG=$IMAGE_TAG
|
||||||
|
|||||||
@@ -82,6 +82,18 @@ export async function POST(req: Request) {
|
|||||||
const { config } = await import("@/lib/config");
|
const { config } = await import("@/lib/config");
|
||||||
const clientName = "MB Grid Solutions";
|
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
|
// 2a. Notification to MB Grid
|
||||||
const notificationHtml = await render(
|
const notificationHtml = await render(
|
||||||
React.createElement(ContactFormNotification, {
|
React.createElement(ContactFormNotification, {
|
||||||
@@ -94,10 +106,7 @@ export async function POST(req: Request) {
|
|||||||
|
|
||||||
await payload.sendEmail({
|
await payload.sendEmail({
|
||||||
from: config.mail.from,
|
from: config.mail.from,
|
||||||
to:
|
to,
|
||||||
config.mail.recipients.join(",") ||
|
|
||||||
process.env.CONTACT_RECIPIENT ||
|
|
||||||
"info@mb-grid-solutions.com",
|
|
||||||
replyTo: email,
|
replyTo: email,
|
||||||
subject: `Kontaktanfrage von ${name}`,
|
subject: `Kontaktanfrage von ${name}`,
|
||||||
html: notificationHtml,
|
html: notificationHtml,
|
||||||
|
|||||||
Reference in New Issue
Block a user