Skip to content

Scheduling infrastructure for absolutely everyone.

chore: Add location to workflow reminder template (#17449)

Anik Dhabal Babu45f8ecbab74f
diff --git a/packages/features/ee/workflows/api/scheduleEmailReminders.ts b/packages/features/ee/workflows/api/scheduleEmailReminders.ts
index 2f5e6bc0ba1..4e1cae4b7f6 100644
--- a/packages/features/ee/workflows/api/scheduleEmailReminders.ts
+++ b/packages/features/ee/workflows/api/scheduleEmailReminders.ts
@@ -247,6 +247,8 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
reminder.booking.endTime.toISOString() || "",
reminder.booking.eventType?.title || "",
timeZone || "",
+ reminder.booking.location || "",
+ bookingMetadataSchema.parse(reminder.booking.metadata || {})?.videoCallUrl || "",
attendeeName || "",
name || "",
!!reminder.booking.user?.hideBranding
@@ -375,6 +377,8 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
reminder.booking.endTime.toISOString() || "",
reminder.booking.eventType?.title || "",
timeZone || "",
+ reminder.booking.location || "",
+ bookingMetadataSchema.parse(reminder.booking.metadata || {})?.videoCallUrl || "",
attendeeName || "",
name || "",
!!reminder.booking.user?.hideBranding
diff --git a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts
index 71265e7347c..6ca689aab73 100644
--- a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts
+++ b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts
@@ -192,6 +192,8 @@ export const scheduleEmailReminder = async (args: scheduleEmailReminderArgs) =>
endTime,
evt.title,
timeZone,
+ evt.location || "",
+ bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl || "",
attendeeName,
name
);
diff --git a/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts b/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
index e9862da5b38..5cd183fae0d 100644
--- a/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
+++ b/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
@@ -1,3 +1,4 @@
+import { guessEventLocationType } from "@calcom/app-store/locations";
import dayjs from "@calcom/dayjs";
import { APP_NAME } from "@calcom/lib/constants";
import { TimeFormat } from "@calcom/lib/timeFormat";
@@ -12,6 +13,8 @@ const emailReminderTemplate = (
endTime?: string,
eventName?: string,
timeZone?: string,
+ location?: string,
+ meetingUrl?: string,
otherPerson?: string,
name?: string,
isBrandingDisabled?: boolean
@@ -20,11 +23,13 @@ const emailReminderTemplate = (
const dateTimeFormat = `ddd, MMM D, YYYY ${currentTimeFormat}`;
let eventDate = "";
+ let locationString = `${guessEventLocationType(location)?.label || location} ${meetingUrl}`;
if (isEditingMode) {
endTime = "{EVENT_END_TIME}";
eventName = "{EVENT_NAME}";
timeZone = "{TIMEZONE}";
+ locationString = "{LOCATION} {MEETING_URL}";
otherPerson = action === WorkflowActions.EMAIL_ATTENDEE ? "{ORGANIZER}" : "{ATTENDEE}";
name = action === WorkflowActions.EMAIL_ATTENDEE ? "{ATTENDEE}" : "{ORGANIZER}";
eventDate = `{EVENT_DATE_${dateTimeFormat}}`;
@@ -46,11 +51,13 @@ const emailReminderTemplate = (
const attendeeHtml = `<div><strong class="editor-text-bold">Attendees: </strong></div>You & ${otherPerson}<br><br>`;
+ const locationHtml = `<div><strong class="editor-text-bold">Location: </strong></div>${locationString}<br><br>`;
+
const branding = !isBrandingDisabled && !isEditingMode ? `<br><br>_<br><br>Scheduling by ${APP_NAME}` : "";
const endingHtml = `This reminder was triggered by a Workflow in Cal.${branding}</body>`;
- const emailBody = introHtml + eventHtml + dateTimeHtml + attendeeHtml + endingHtml;
+ const emailBody = introHtml + eventHtml + dateTimeHtml + attendeeHtml + locationHtml + endingHtml;
return { emailSubject, emailBody };
};