From 95aa5fe30839642b1ab2e3f8ccf2e17fa4a7a7d7 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Sun, 3 Apr 2022 18:59:40 +0100 Subject: [PATCH] Fix - Email Notes (#2356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Peer Richelsen Co-authored-by: Omar López --- apps/web/pages/api/book/event.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/api/book/event.ts b/apps/web/pages/api/book/event.ts index d9e2f7dd96..ebf85cad8e 100644 --- a/apps/web/pages/api/book/event.ts +++ b/apps/web/pages/api/book/event.ts @@ -326,7 +326,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) (str, input) => str + "

" + input.label + ":
" + input.value, "" ); - const evt: CalendarEvent = { type: eventType.title, title: getEventName(eventNameObject), //this needs to be either forced in english, or fetched for each attendee and organizer separately @@ -530,6 +529,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) if (rescheduleUid) { // Use EventManager to conditionally use all needed integrations. const updateManager = await eventManager.update(evt, rescheduleUid); + // This gets overridden when updating the event - to check if notes have been hidden or not. We just reset this back + // to the default description when we are sending the emails. + evt.description = description; results = updateManager.results; referencesToCreate = updateManager.referencesToCreate; @@ -564,6 +566,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) // Use EventManager to conditionally use all needed integrations. const createManager = await eventManager.create(evt); + // This gets overridden when creating the event - to check if notes have been hidden or not. We just reset this back + // to the default description when we are sending the emails. + evt.description = description; + results = createManager.results; referencesToCreate = createManager.referencesToCreate;