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

@@ -50,6 +50,18 @@ export const BaseScheduledEmail = (
)}, ${t(getRecipientStart("MMMM").toLowerCase())} ${getRecipientStart("D, YYYY")}`,
});
let rescheduledBy = props.calEvent.rescheduledBy;
if (
rescheduledBy &&
rescheduledBy === props.calEvent.organizer.email &&
props.calEvent.hideOrganizerEmail
) {
const personWhoRescheduled = [props.calEvent.organizer, ...props.calEvent.attendees].find(
(person) => person.email === rescheduledBy
);
rescheduledBy = personWhoRescheduled?.name;
}
return (
<BaseEmailHtml
hideLogo={Boolean(props.calEvent.platformClientId)}
@@ -105,9 +117,7 @@ export const BaseScheduledEmail = (
)}
</>
)}
{props.calEvent.rescheduledBy && (
<Info label={t("rescheduled_by")} description={props.calEvent.rescheduledBy} withSpacer />
)}
{rescheduledBy && <Info label={t("rescheduled_by")} description={rescheduledBy} withSpacer />}
<Info label={t("what")} description={props.calEvent.title} withSpacer />
<WhenInfo timeFormat={timeFormat} calEvent={props.calEvent} t={t} timeZone={timeZone} locale={locale} />
<WhoInfo calEvent={props.calEvent} t={t} />