fix: hide organizer info on rescheduled events (#21541)

* fix(email): hide organizer info on rescheduled events

* hide organizer email on bookings-single-view

* replace organizer email with name

* sanitize previous booking only

* clean up code

* fix dumb error
This commit is contained in:
Eunjae Lee authored and GitHub committed 2025-05-27 15:35:16 +00:00
1 parent 08e35e4698
commit 3131318b6a
2 files changed
+22 -4

No files matched your search

@@ -217,6 +217,14 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
const internalNotes = await getInternalNotePresets(eventType.team?.id ?? eventType.parent?.teamId ?? null);
// Filter out organizer information if hideOrganizerEmail is true
const sanitizedPreviousBooking =
eventType.hideOrganizerEmail &&
previousBooking &&
previousBooking.rescheduledBy === bookingInfo.user?.email
? { ...previousBooking, rescheduledBy: bookingInfo.user?.name }
: previousBooking;
return {
props: {
orgSlug: currentOrgDomain,
@@ -227,7 +235,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
recurringBookings: await getRecurringBookings(bookingInfo.recurringEventId),
dynamicEventName: bookingInfo?.eventType?.eventName || "",
bookingInfo,
previousBooking,
previousBooking: sanitizedPreviousBooking,
paymentStatus: payment,
...(tz && { tz }),
userTimeFormat,