Compare commits

...

1 Commits

Author SHA1 Message Date
Matti Nannt
0cb3881cd0 fix: return weekly-summary cron early when SMTP not configured (#6344) 2025-07-31 22:03:35 +02:00

View File

@@ -1,8 +1,9 @@
import { responses } from "@/app/lib/api/response";
import { CRON_SECRET } from "@/lib/constants";
import { CRON_SECRET, SMTP_HOST } from "@/lib/constants";
import { hasUserEnvironmentAccess } from "@/lib/environment/auth";
import { sendNoLiveSurveyNotificationEmail, sendWeeklySummaryNotificationEmail } from "@/modules/email";
import { headers } from "next/headers";
import { logger } from "@formbricks/logger";
import { getNotificationResponse } from "./lib/notificationResponse";
import { getOrganizationIds } from "./lib/organization";
import { getProjectsByOrganizationId } from "./lib/project";
@@ -16,6 +17,11 @@ export const POST = async (): Promise<Response> => {
return responses.notAuthenticatedResponse();
}
if (!SMTP_HOST) {
logger.info("SMTP_HOST is not configured, skipping weekly summary email");
return responses.successResponse({}, true);
}
const emailSendingPromises: Promise<void>[] = [];
// Fetch all organization IDs