Skip daily summary emails for contact-only events

Contact-only events have no registration flow, so their daily
summary (registration/payment stats) was always empty — exclude
them from the query instead of sending a pointless email.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-22 21:22:53 +02:00
co-authored by Claude Sonnet 5
parent 4e63a78e8e
commit 5a9137e252
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -1370,14 +1370,14 @@ async function sendDailyEventSummaries(now = new Date()) {
const today = new Date(now);
const notifyInclude = { createdBy: { select: { id: true, name: true, email: true } }, notifyRecipients: { select: { id: true, name: true, email: true } } };
let events = await prisma.event.findMany({
where: { isActive: true, startDate: { gte: today } },
where: { isActive: true, startDate: { gte: today }, requiresRegistration: true },
include: notifyInclude,
orderBy: { startDate: 'asc' },
});
try {
events = await prisma.event.findMany({
where: { isActive: true, startDate: { gte: today }, goLiveAt: { lte: today } },
where: { isActive: true, startDate: { gte: today }, goLiveAt: { lte: today }, requiresRegistration: true },
include: notifyInclude,
orderBy: { startDate: 'asc' },
});