Skip to content

Scheduling infrastructure for absolutely everyone.

Stops users who are not in getting the "Requires confirmation" email (#3084)

sean-brydond44c8f79121a
diff --git a/apps/web/pages/api/book/confirm.ts b/apps/web/pages/api/book/confirm.ts
index 1f1beb60246..204c99a9bba 100644
--- a/apps/web/pages/api/book/confirm.ts
+++ b/apps/web/pages/api/book/confirm.ts
@@ -105,6 +105,7 @@ async function patchHandler(req: NextApiRequest) {
eventType: {
select: {
recurringEvent: true,
+ requiresConfirmation: true,
},
},
location: true,
@@ -176,6 +177,7 @@ async function patchHandler(req: NextApiRequest) {
location: booking.location ?? "",
uid: booking.uid,
destinationCalendar: booking?.destinationCalendar || currentUser.destinationCalendar,
+ requiresConfirmation: booking?.eventType?.requiresConfirmation ?? false,
};
const recurringEvent = parseRecurringEvent(booking.eventType?.recurringEvent);
diff --git a/apps/web/pages/api/book/event.ts b/apps/web/pages/api/book/event.ts
index 1399d409627..aea5603d4b3 100644
--- a/apps/web/pages/api/book/event.ts
+++ b/apps/web/pages/api/book/event.ts
@@ -402,6 +402,7 @@ async function handler(req: NextApiRequest) {
/** For team events & dynamic collective events, we will need to handle each member destinationCalendar eventually */
destinationCalendar: eventType.destinationCalendar || organizerUser.destinationCalendar,
hideCalendarNotes: eventType.hideCalendarNotes,
+ requiresConfirmation: eventType.requiresConfirmation ?? false,
};
if (eventType.schedulingType === SchedulingType.COLLECTIVE) {
diff --git a/apps/web/playwright/integrations.test.ts b/apps/web/playwright/integrations.test.ts
index 2d918fcb84a..b078d9dc352 100644
--- a/apps/web/playwright/integrations.test.ts
+++ b/apps/web/playwright/integrations.test.ts
@@ -75,6 +75,7 @@ test.describe("Integrations", () => {
body.payload.uid = dynamic;
body.payload.bookingId = dynamic;
body.payload.additionalInformation = dynamic;
+ body.payload.requiresConfirmation = dynamic;
// if we change the shape of our webhooks, we can simply update this by clicking `u`
// console.log("BODY", body);
diff --git a/apps/web/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt b/apps/web/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt
index b71943b3714..283a523db65 100644
--- a/apps/web/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt
+++ b/apps/web/playwright/integrations.test.ts-snapshots/webhookResponse-chromium.txt
@@ -1 +1 @@
-{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between PRO and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"PRO","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"[email protected]","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"uid":"[redacted/dynamic]","bookingId":"[redacted/dynamic]","metadata":{},"additionalInformation":"[redacted/dynamic]"}}
\ No newline at end of file
+{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between PRO and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"PRO","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"[email protected]","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"requiresConfirmation":"[redacted/dynamic]","uid":"[redacted/dynamic]","bookingId":"[redacted/dynamic]","metadata":{},"additionalInformation":"[redacted/dynamic]"}}
\ No newline at end of file
diff --git a/packages/emails/src/components/LocationInfo.tsx b/packages/emails/src/components/LocationInfo.tsx
index 4a985aac661..7926cd9c2b7 100644
--- a/packages/emails/src/components/LocationInfo.tsx
+++ b/packages/emails/src/components/LocationInfo.tsx
@@ -108,14 +108,13 @@ export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
/>
);
}
-
return (
<Info
label={t("where")}
withSpacer
description={providerName || props.calEvent.location}
extraInfo={
- providerName === "Zoom" || providerName === "Google" ? (
+ (providerName === "Zoom" || providerName === "Google") && props.calEvent.requiresConfirmation ? (
<p style={{ color: "#494949", fontWeight: 400, lineHeight: "24px" }}>
<>{t("meeting_url_provided_after_confirmed")}</>
</p>
diff --git a/packages/types/Calendar.d.ts b/packages/types/Calendar.d.ts
index b867a11756b..c8be77934b9 100644
--- a/packages/types/Calendar.d.ts
+++ b/packages/types/Calendar.d.ts
@@ -116,6 +116,7 @@ export interface CalendarEvent {
uid?: string | null;
videoCallData?: VideoCallData;
paymentInfo?: PaymentInfo | null;
+ requiresConfirmation?: boolean | null;
destinationCalendar?: DestinationCalendar | null;
cancellationReason?: string | null;
rejectionReason?: string | null;