feat(events): add calendar email support
Help registrants add events to their calendars and keep waitlisted places distinct from confirmed attendance.
This commit is contained in:
@@ -110,6 +110,7 @@ async function promoteEvent(
|
||||
if (slots <= 0) break;
|
||||
|
||||
const email = (registration as { email?: unknown }).email;
|
||||
const fullName = (registration as { fullName?: unknown }).fullName;
|
||||
if (typeof email !== 'string' || email.length === 0) {
|
||||
strapi.log.warn(
|
||||
`${LOG_PREFIX} registration ${registration.documentId} has no email; left waitlisted.`,
|
||||
@@ -122,6 +123,10 @@ async function promoteEvent(
|
||||
to: email,
|
||||
state: 'confirmed',
|
||||
eventReference: { documentId: eventDocumentId },
|
||||
reservation: {
|
||||
id: registration.documentId as string,
|
||||
name: typeof fullName === 'string' ? fullName : undefined,
|
||||
},
|
||||
});
|
||||
|
||||
if (!ok) {
|
||||
|
||||
Reference in New Issue
Block a user