diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts index a19eecfb7b..222dcd9bd0 100644 --- a/packages/features/bookings/lib/handleNewBooking.ts +++ b/packages/features/bookings/lib/handleNewBooking.ts @@ -2291,8 +2291,7 @@ async function handler( loggerWithEventDetails.error("Error while creating booking references", JSON.stringify({ error })); } - const metadataFromEvent = videoCallUrl ? { videoCallUrl } : undefined; - const evtWithMetadata = { ...evt, metadata: metadataFromEvent, eventType: { slug: eventType.slug } }; + const evtWithMetadata = { ...evt, metadata, eventType: { slug: eventType.slug } }; await scheduleMandatoryReminder( evtWithMetadata, diff --git a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts index e45cdaa920..6b70ba1da8 100644 --- a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts +++ b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts @@ -5,6 +5,7 @@ import type { DateArray } from "ics"; import { RRule } from "rrule"; import { v4 as uuidv4 } from "uuid"; +import { guessEventLocationType } from "@calcom/app-store/locations"; import dayjs from "@calcom/dayjs"; import { preprocessNameFieldDataWithVariant } from "@calcom/features/form-builder/utils"; import logger from "@calcom/lib/logger"; @@ -33,6 +34,12 @@ function getiCalEventAsString(evt: BookingInfo, status?: ParticipationStatus) { recurrenceRule = new RRule(evt.eventType.recurringEvent).toString().replace("RRULE:", ""); } + let location = bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl; + + if (!location) { + location = guessEventLocationType(location)?.label || evt.location || ""; + } + const icsEvent = createEvent({ uid, startInputType: "utc", @@ -44,7 +51,7 @@ function getiCalEventAsString(evt: BookingInfo, status?: ParticipationStatus) { duration: { minutes: dayjs(evt.endTime).diff(dayjs(evt.startTime), "minute") }, title: evt.title, description: evt.additionalNotes || "", - location: evt.location || "", + location, organizer: { email: evt.organizer.email || "", name: evt.organizer.name }, attendees: [ {