diff --git a/app/api/cron/emails/route.ts b/app/api/cron/emails/route.ts index 8a832bc..066f94c 100644 --- a/app/api/cron/emails/route.ts +++ b/app/api/cron/emails/route.ts @@ -10,7 +10,10 @@ export async function GET(req: Request) { const result = await runCronEmails(); if (!result.success) { - return NextResponse.json({ success: false, error: "Database unavailable" }, { status: 500 }); + // Report the cause the workflow actually returned. Hardcoding one of the + // two made an email-configuration failure read as a database failure, and + // the operator chased Postgres while the sender address was the problem. + return NextResponse.json({ success: false, error: result.error }, { status: 500 }); } return NextResponse.json(result); } diff --git a/lib/workflows/cron-emails.ts b/lib/workflows/cron-emails.ts index fe5840e..faf16b4 100644 --- a/lib/workflows/cron-emails.ts +++ b/lib/workflows/cron-emails.ts @@ -28,7 +28,15 @@ export async function runCronEmails(now: Date = new Date()): Promise