Skip to content

Scheduling infrastructure for absolutely everyone.

fix: platform confirmed/declined meeting attendee reschedule email url (#23335)

Lauris Skraucisd0e59f1824c8
diff --git a/apps/api/v2/package.json b/apps/api/v2/package.json
index abadfb2df6a..33994787c1f 100644
--- a/apps/api/v2/package.json
+++ b/apps/api/v2/package.json
@@ -38,7 +38,7 @@
"@axiomhq/winston": "^1.2.0",
"@calcom/platform-constants": "*",
"@calcom/platform-enums": "*",
- "@calcom/platform-libraries": "npm:@calcom/[email protected]",
+ "@calcom/platform-libraries": "npm:@calcom/[email protected]",
"@calcom/platform-types": "*",
"@calcom/platform-utils": "*",
"@calcom/prisma": "*",
diff --git a/apps/web/app/api/link/route.ts b/apps/web/app/api/link/route.ts
index c83ed66b099..5dc486e0c46 100644
--- a/apps/web/app/api/link/route.ts
+++ b/apps/web/app/api/link/route.ts
@@ -30,6 +30,10 @@ const querySchema = z.object({
const decryptedSchema = z.object({
bookingUid: z.string(),
userId: z.number().int(),
+ platformClientId: z.string().optional(),
+ platformRescheduleUrl: z.string().optional(),
+ platformCancelUrl: z.string().optional(),
+ platformBookingUrl: z.string().optional(),
});
// Move the sessionGetter function outside the GET function
@@ -64,7 +68,14 @@ async function handler(request: NextRequest) {
symmetricDecrypt(decodeURIComponent(token), process.env.CALENDSO_ENCRYPTION_KEY || "")
);
- const { bookingUid, userId } = decryptedSchema.parse(decryptedData);
+ const {
+ bookingUid,
+ userId,
+ platformClientId,
+ platformRescheduleUrl,
+ platformCancelUrl,
+ platformBookingUrl,
+ } = decryptedSchema.parse(decryptedData);
const booking = await prisma.booking.findUniqueOrThrow({
where: { uid: bookingUid },
@@ -97,6 +108,14 @@ async function handler(request: NextRequest) {
recurringEventId: booking.recurringEventId || undefined,
confirmed: action === DirectAction.ACCEPT,
reason,
+ platformClientParams: platformClientId
+ ? {
+ platformClientId,
+ platformRescheduleUrl,
+ platformCancelUrl,
+ platformBookingUrl,
+ }
+ : undefined,
});
} catch (e) {
let message = "Error confirming booking";
diff --git a/packages/emails/src/templates/OrganizerRequestEmail.tsx b/packages/emails/src/templates/OrganizerRequestEmail.tsx
index 2d16770065e..9bbb11f5aa5 100644
--- a/packages/emails/src/templates/OrganizerRequestEmail.tsx
+++ b/packages/emails/src/templates/OrganizerRequestEmail.tsx
@@ -5,7 +5,14 @@ import { CallToAction, Separator, CallToActionTable } from "../components";
import { OrganizerScheduledEmail } from "./OrganizerScheduledEmail";
export const OrganizerRequestEmail = (props: React.ComponentProps<typeof OrganizerScheduledEmail>) => {
- const seedData = { bookingUid: props.calEvent.uid, userId: props.calEvent.organizer.id };
+ const seedData = {
+ bookingUid: props.calEvent.uid,
+ userId: props.calEvent.organizer.id,
+ platformClientId: props.calEvent.platformClientId,
+ platformRescheduleUrl: props.calEvent.platformRescheduleUrl,
+ platformCancelUrl: props.calEvent.platformCancelUrl,
+ platformBookingUrl: props.calEvent.platformBookingUrl,
+ };
const token = symmetricEncrypt(JSON.stringify(seedData), process.env.CALENDSO_ENCRYPTION_KEY || "");
//TODO: We should switch to using org domain if available
const actionHref = `${WEBAPP_URL}/api/link/?token=${encodeURIComponent(token)}`;
diff --git a/yarn.lock b/yarn.lock
index 8f7c5b9816b..cd0831d23a0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2493,7 +2493,7 @@ __metadata:
"@axiomhq/winston": ^1.2.0
"@calcom/platform-constants": "*"
"@calcom/platform-enums": "*"
- "@calcom/platform-libraries": "npm:@calcom/[email protected]"
+ "@calcom/platform-libraries": "npm:@calcom/[email protected]"
"@calcom/platform-types": "*"
"@calcom/platform-utils": "*"
"@calcom/prisma": "*"
@@ -3553,13 +3553,13 @@ __metadata:
languageName: unknown
linkType: soft
-"@calcom/platform-libraries@npm:@calcom/[email protected]":
- version: 0.0.333
- resolution: "@calcom/platform-libraries@npm:0.0.333"
+"@calcom/platform-libraries@npm:@calcom/[email protected]":
+ version: 0.0.335
+ resolution: "@calcom/platform-libraries@npm:0.0.335"
dependencies:
"@calcom/features": "*"
"@calcom/lib": "*"
- checksum: 321c792aeb36ec69b7a02756ac550736bd9a71e4544fcebd9ab625bc2132edd5bf3e86295af05d797ff82de0ec35f3954c7409543e4325b7cbbbb55ce786ef60
+ checksum: 1c4568a47c118f2e0501a392bc259d1a8ca97d88bd13a53d80655f0eee068152aa9086bc1d90cfad4349268bca3c570a3762d622bff811954d0a84104473b8ce
languageName: node
linkType: hard