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:
@@ -7,6 +7,10 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Contact-only events (no registration possible) were still getting the daily summary email — it now skips them since there's nothing to summarize.
|
||||||
|
|
||||||
## [1.9.1] - 2026-08-22
|
## [1.9.1] - 2026-08-22
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1370,14 +1370,14 @@ async function sendDailyEventSummaries(now = new Date()) {
|
|||||||
const today = new Date(now);
|
const today = new Date(now);
|
||||||
const notifyInclude = { createdBy: { select: { id: true, name: true, email: true } }, notifyRecipients: { select: { id: true, name: true, email: true } } };
|
const notifyInclude = { createdBy: { select: { id: true, name: true, email: true } }, notifyRecipients: { select: { id: true, name: true, email: true } } };
|
||||||
let events = await prisma.event.findMany({
|
let events = await prisma.event.findMany({
|
||||||
where: { isActive: true, startDate: { gte: today } },
|
where: { isActive: true, startDate: { gte: today }, requiresRegistration: true },
|
||||||
include: notifyInclude,
|
include: notifyInclude,
|
||||||
orderBy: { startDate: 'asc' },
|
orderBy: { startDate: 'asc' },
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
events = await prisma.event.findMany({
|
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,
|
include: notifyInclude,
|
||||||
orderBy: { startDate: 'asc' },
|
orderBy: { startDate: 'asc' },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user