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

fix: meeting url missing in workflow email #16434

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/features/bookings/lib/handleCancelBooking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import prisma, { bookingMinimalSelect } from "@calcom/prisma";
import type { WebhookTriggerEvents } from "@calcom/prisma/enums";
import { BookingStatus } from "@calcom/prisma/enums";
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
import { EventTypeMetaDataSchema, schemaBookingCancelParams } from "@calcom/prisma/zod-utils";
import {
bookingMetadataSchema,
EventTypeMetaDataSchema,
schemaBookingCancelParams,
} from "@calcom/prisma/zod-utils";
import type { EventTypeMetadata } from "@calcom/prisma/zod-utils";
import {
deleteAllWorkflowReminders,
Expand Down Expand Up @@ -359,6 +363,7 @@ async function handler(req: CustomRequest) {
smsReminderNumber: bookingToDelete.smsReminderNumber,
evt: {
...evt,
metadata: { videoCallUrl: bookingMetadataSchema.parse(bookingToDelete.metadata || {})?.videoCallUrl },
...{
eventType: {
slug: bookingToDelete.eventType?.slug,
Expand Down
5 changes: 3 additions & 2 deletions packages/features/ee/round-robin/roundRobinReassignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ export const roundRobinReassignment = async ({ bookingId }: { bookingId: number
},
});

const workflowEventMetadata = { videoCallUrl: getVideoCallUrlFromCalEvent(evt) };

for (const workflowReminder of workflowReminders) {
const workflowStep = workflowReminder?.workflowStep;
const workflow = workflowStep?.workflow;
Expand All @@ -470,6 +472,7 @@ export const roundRobinReassignment = async ({ bookingId }: { bookingId: number
await scheduleEmailReminder({
evt: {
...evt,
metadata: workflowEventMetadata,
eventType,
},
action: WorkflowActions.EMAIL_HOST,
Expand Down Expand Up @@ -531,8 +534,6 @@ export const roundRobinReassignment = async ({ bookingId }: { bookingId: number
},
});

const workflowEventMetadata = { videoCallUrl: getVideoCallUrlFromCalEvent(evt) };

await scheduleWorkflowReminders({
workflows: newEventWorkflows,
smsReminderNumber: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export const activateEventTypeHandler = async ({ ctx, input }: ActivateEventType
schedulingType: booking.eventType?.schedulingType,
hosts: booking.eventType?.hosts,
},
metadata: booking.metadata,
};
for (const step of eventTypeWorkflow.steps) {
if (
Expand Down
2 changes: 2 additions & 0 deletions packages/trpc/server/routers/viewer/workflows/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const bookingSelect = {
endTime: true,
title: true,
uid: true,
metadata: true,
attendees: {
select: {
name: true,
Expand Down Expand Up @@ -751,6 +752,7 @@ export async function scheduleBookingReminders(
schedulingType: booking.eventType?.schedulingType,
hosts: booking.eventType?.hosts,
},
metadata: booking.metadata,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is metadata being added here?

};
if (
step.action === WorkflowActions.EMAIL_HOST ||
Expand Down
Loading