Scheduling infrastructure for absolutely everyone.
Fixing rescheduled email date (#5035)
Leo Giovanetti83442caf8605
diff --git a/packages/emails/src/components/WhenInfo.tsx b/packages/emails/src/components/WhenInfo.tsxindex 3f08a78afc4..ac258436a64 100644--- a/packages/emails/src/components/WhenInfo.tsx+++ b/packages/emails/src/components/WhenInfo.tsx@@ -37,7 +37,9 @@ export function WhenInfo(props: { calEvent: CalendarEvent; timeZone: string; t:<div><Infolabel={`${t("when")} ${getRecurringWhen(props)}`}- lineThrough={!!props.calEvent.cancellationReason}+ lineThrough={+ !!props.calEvent.cancellationReason && !props.calEvent.cancellationReason.includes("$RCH$")+ }description={<>{recurringEvent?.count ? `${t("starting")} ` : ""}diff --git a/packages/emails/src/templates/BaseScheduledEmail.tsx b/packages/emails/src/templates/BaseScheduledEmail.tsxindex 1f66469a978..a00f98e1aca 100644--- a/packages/emails/src/templates/BaseScheduledEmail.tsx+++ b/packages/emails/src/templates/BaseScheduledEmail.tsx@@ -56,7 +56,13 @@ export const BaseScheduledEmail = (: props.callToAction || <ManageLink attendee={props.attendee} calEvent={props.calEvent} />}subtitle={props.subtitle || <>{t("emailed_you_and_any_other_attendees")}</>}>- <Info label={t("cancellation_reason")} description={props.calEvent.cancellationReason} withSpacer />+ <Info+ label={t("cancellation_reason")}+ description={+ props.calEvent.cancellationReason && props.calEvent.cancellationReason.replace("$RCH$", "")+ } // Removing flag to distinguish reschedule from cancellation+ withSpacer+ /><Info label={t("rejection_reason")} description={props.calEvent.rejectionReason} withSpacer /><Info label={t("what")} description={props.calEvent.type} withSpacer /><WhenInfo calEvent={props.calEvent} t={t} timeZone={timeZone} />diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.tsindex 77f359059c1..4f9d594c471 100644--- a/packages/features/bookings/lib/handleNewBooking.ts+++ b/packages/features/bookings/lib/handleNewBooking.ts@@ -752,7 +752,7 @@ async function handler(req: NextApiRequest & { userId?: number }) {...evt,additionalInformation: metadata,additionalNotes, // Resets back to the additionalNote input and not the override value- cancellationReason: reqBody.rescheduleReason,+ cancellationReason: "$RCH$" + reqBody.rescheduleReason, // Removable code prefix to differentiate cancellation from rescheduling for email});}}