From 0761e8664a867f0a171db3995cac346056a979b6 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Mon, 30 May 2022 15:40:29 -0400 Subject: [PATCH] Add reschedule reason to DB and emails (#2909) * Write reschedule reason to db * Add reschedule reason to emails * Add reschedule reason to request reschedule email * Add reschedule reason to request reschedule email * Add reschedule reason to request reschedule email * Add reschedule reason to request reschedule email * Write reschedule reason to db * Add reschedule reason to emails * No longer using rescheduleReason in favor of cancellationReason * Update apps emails accordingly with reschedule reason * Update reschedule.test.ts Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Alan Co-authored-by: zomars --- .../components/booking/pages/BookingPage.tsx | 35 +++++++++++++------ .../attendee-request-reschedule-email.ts | 2 ++ .../templates/attendee-rescheduled-email.ts | 2 ++ .../templates/attendee-scheduled-email.ts | 8 +++++ .../organizer-request-reschedule-email.ts | 2 ++ .../templates/organizer-rescheduled-email.ts | 2 ++ .../templates/organizer-scheduled-email.ts | 8 +++++ apps/web/pages/api/book/event.ts | 18 ++++++++-- apps/web/playwright/reschedule.test.ts | 2 +- apps/web/public/static/locales/en/common.json | 2 ++ .../attendee-request-reschedule-email.ts | 2 ++ .../vital/lib/templates/base-template.ts | 8 +++++ .../organizer-request-reschedule-email.ts | 2 ++ .../attendee-request-reschedule-email.ts | 2 ++ .../lib/templates/base-template.ts | 8 +++++ .../organizer-request-reschedule-email.ts | 2 ++ packages/core/EventManager.ts | 13 ++++++- 17 files changed, 103 insertions(+), 15 deletions(-) diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index f02c3deda8..458561742c 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -83,6 +83,7 @@ type BookingFormValues = { customInputs?: { [key: string]: string | boolean; }; + rescheduleReason?: string; }; const BookingPage = ({ @@ -255,6 +256,7 @@ const BookingPage = ({ email: primaryAttendee.email || "", guests: guestListEmails, notes: booking.description || "", + rescheduleReason: "", customInputs: eventType.customInputs.reduce( (customInputs, input) => ({ ...customInputs, @@ -786,18 +788,31 @@ const BookingPage = ({ -