Fixing rescheduled email date (#5035)

This commit is contained in:
Leo Giovanetti 2022-10-16 14:46:10 -03:00 committed by GitHub
parent e6f912bf0c
commit 83442caf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -37,7 +37,9 @@ export function WhenInfo(props: { calEvent: CalendarEvent; timeZone: string; t:
<div>
<Info
label={`${t("when")} ${getRecurringWhen(props)}`}
lineThrough={!!props.calEvent.cancellationReason}
lineThrough={
!!props.calEvent.cancellationReason && !props.calEvent.cancellationReason.includes("$RCH$")
}
description={
<>
{recurringEvent?.count ? `${t("starting")} ` : ""}

View File

@ -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} />

View File

@ -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
});
}
}