Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing rescheduled booking email date #5035

Merged
merged 1 commit into from Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/emails/src/components/WhenInfo.tsx
Expand Up @@ -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")} ` : ""}
Expand Down
8 changes: 7 additions & 1 deletion packages/emails/src/templates/BaseScheduledEmail.tsx
Expand Up @@ -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} />
Expand Down
2 changes: 1 addition & 1 deletion packages/features/bookings/lib/handleNewBooking.ts
Expand Up @@ -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
});
}
}
Expand Down