From fee19654b0c987c5399e73619c60d648a78e6314 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Wed, 31 Dec 2025 09:23:38 +0530 Subject: [PATCH] fix: meetin url (#26321) --- .../features/tasker/tasks/sendWorkflowEmails.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/features/tasker/tasks/sendWorkflowEmails.ts b/packages/features/tasker/tasks/sendWorkflowEmails.ts index dbd5ac6870..2520bdbf0e 100644 --- a/packages/features/tasker/tasks/sendWorkflowEmails.ts +++ b/packages/features/tasker/tasks/sendWorkflowEmails.ts @@ -6,6 +6,7 @@ import { BookingRepository } from "@calcom/features/bookings/repositories/Bookin import { BookingSeatRepository } from "@calcom/features/bookings/repositories/BookingSeatRepository"; import { EmailWorkflowService } from "@calcom/features/ee/workflows/lib/service/EmailWorkflowService"; import { WorkflowReminderRepository } from "@calcom/features/ee/workflows/repositories/WorkflowReminderRepository"; +import { bookingMetadataSchema } from "@calcom/prisma/zod-utils"; import { prisma } from "@calcom/prisma"; export const ZSendWorkflowEmailsSchemaEager = z.object({ @@ -53,12 +54,23 @@ export async function sendWorkflowEmails(payload: string): Promise { if (!calendarEvent) { throw new Error("Calendar event could not be built"); } + + // Check if videoCallUrl exists in booking metadata and add it to evt.metadata + const bookingMetadata = bookingMetadataSchema.parse(booking.metadata || {}); + const metadata = bookingMetadata?.videoCallUrl + ? { + videoCallUrl: bookingMetadata.videoCallUrl, + } + : undefined; + + const evtWithMetadata = { ...calendarEvent, metadata }; + const workflowReminderRepository = new WorkflowReminderRepository(prisma); const bookingSeatRepository = new BookingSeatRepository(prisma); const emailWorkflowService = new EmailWorkflowService(workflowReminderRepository, bookingSeatRepository); await emailWorkflowService.handleSendEmailWorkflowTask({ - evt: calendarEvent, + evt: evtWithMetadata, workflowReminderId: mailData.workflowReminderId, });