Skip to content

Commit dc3e681

Browse files
fix: hide cancel/reschedule links in emails when disabled (calcom#27637)
When disableCancelling or disableRescheduling is enabled on an event type, the confirmation email still showed non-functional cancel/reschedule links. The ManageLink email component already had correct conditional logic to hide these links, but two flows constructed the CalendarEvent manually without including the flags: the booking confirmation handler and the payment booking flow. This caused the flags to be undefined, which ManageLink interpreted as enabled. Added disableCancelling and disableRescheduling to the Prisma select and CalendarEvent object in both confirm.handler.ts and getBooking.ts. Closes calcom#22906
1 parent 30bba3d commit dc3e681

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

packages/features/bookings/lib/payment/getBooking.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export async function getBooking(bookingId: number) {
9090
},
9191
seatsPerTimeSlot: true,
9292
seatsShowAttendees: true,
93+
disableCancelling: true,
94+
disableRescheduling: true,
9395
},
9496
},
9597
metadata: true,
@@ -200,6 +202,8 @@ export async function getBooking(bookingId: number) {
200202
customReplyToEmail: booking.eventType?.customReplyToEmail,
201203
seatsPerTimeSlot: booking.eventType?.seatsPerTimeSlot,
202204
seatsShowAttendees: booking.eventType?.seatsShowAttendees,
205+
disableCancelling: booking.eventType?.disableCancelling ?? false,
206+
disableRescheduling: booking.eventType?.disableRescheduling ?? false,
203207
};
204208

205209
return {

packages/trpc/server/routers/viewer/bookings/confirm.handler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
155155
hideCalendarNotes: true,
156156
hideCalendarEventDetails: true,
157157
disableGuests: true,
158+
disableCancelling: true,
159+
disableRescheduling: true,
158160
customReplyToEmail: true,
159161
seatsPerTimeSlot: true,
160162
seatsShowAttendees: true,
@@ -331,6 +333,8 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
331333
customReplyToEmail: booking.eventType?.customReplyToEmail,
332334
seatsPerTimeSlot: booking.eventType?.seatsPerTimeSlot,
333335
seatsShowAttendees: booking.eventType?.seatsShowAttendees,
336+
disableCancelling: booking.eventType?.disableCancelling ?? false,
337+
disableRescheduling: booking.eventType?.disableRescheduling ?? false,
334338
team: booking.eventType?.team
335339
? {
336340
name: booking.eventType.team.name,

0 commit comments

Comments
 (0)