Skip to content

Scheduling infrastructure for absolutely everyone.

Hide attendees from calendar description (#6800)

Joe Au-Yeung4f9aa8bd963e
diff --git a/apps/web/playwright/webhook.e2e.ts-snapshots/webhookResponse--calcom-web.txt b/apps/web/playwright/webhook.e2e.ts-snapshots/webhookResponse--calcom-web.txt
index 5fd8426c396..2a1b33ed0a2 100644
--- a/apps/web/playwright/webhook.e2e.ts-snapshots/webhookResponse--calcom-web.txt
+++ b/apps/web/playwright/webhook.e2e.ts-snapshots/webhookResponse--calcom-web.txt
@@ -1 +1 @@
-{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between Nameless and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"id":"[redacted/dynamic]","name":"Nameless","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"[email protected]","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"requiresConfirmation":"[redacted/dynamic]","eventTypeId":"[redacted/dynamic]","seatsShowAttendees":false,"uid":"[redacted/dynamic]","videoCallData":"[redacted/dynamic]","appsStatus":"[redacted/dynamic]","eventTitle":"30 min","eventDescription":null,"price":0,"currency":"usd","length":30,"bookingId":"[redacted/dynamic]","metadata":{"videoCallUrl":"[redacted/dynamic]"},"status":"ACCEPTED","additionalInformation":"[redacted/dynamic]"}}
\ No newline at end of file
+{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between Nameless and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"id":"[redacted/dynamic]","name":"Nameless","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"[email protected]","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"requiresConfirmation":"[redacted/dynamic]","eventTypeId":"[redacted/dynamic]","seatsShowAttendees":false,"seatsPerTimeSlot":null,"uid":"[redacted/dynamic]","videoCallData":"[redacted/dynamic]","appsStatus":"[redacted/dynamic]","eventTitle":"30 min","eventDescription":null,"price":0,"currency":"usd","length":30,"bookingId":"[redacted/dynamic]","metadata":{"videoCallUrl":"[redacted/dynamic]"},"status":"ACCEPTED","additionalInformation":"[redacted/dynamic]"}}
\ No newline at end of file
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 7f2f89c8463..c8659ce66a9 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -1543,6 +1543,7 @@
"delete_sso_configuration": "Delete {{connectionType}} configuration",
"delete_sso_configuration_confirmation": "Yes, delete {{connectionType}} configuration",
"delete_sso_configuration_confirmation_description": "Are you sure you want to delete the {{connectionType}} configuration? Your team members who use {{connectionType}} login will no longer be able to access Cal.com.",
+ "organizer_timezone": "Organizer timezone",
"email_no_user_cta":"Create your account",
"email_user_cta":"View Invitation",
"email_no_user_invite_heading":"You’ve been invited to join a team on {{appName}}",
diff --git a/packages/core/EventManager.ts b/packages/core/EventManager.ts
index af95df3bc6e..51eae74e049 100644
--- a/packages/core/EventManager.ts
+++ b/packages/core/EventManager.ts
@@ -328,6 +328,7 @@ export default class EventManager {
private async createAllCalendarEvents(event: CalendarEvent) {
/** Can I use destinationCalendar here? */
/* How can I link a DC to a cred? */
+
let createdEvents: EventResult<NewCalendarEventType>[] = [];
if (event.destinationCalendar) {
if (event.destinationCalendar.credentialId) {
diff --git a/packages/emails/templates/attendee-scheduled-email.ts b/packages/emails/templates/attendee-scheduled-email.ts
index b1a6f1ffd14..dec4f75a625 100644
--- a/packages/emails/templates/attendee-scheduled-email.ts
+++ b/packages/emails/templates/attendee-scheduled-email.ts
@@ -22,6 +22,10 @@ export default class AttendeeScheduledEmail extends BaseEmail {
this.attendee = attendee;
this.showAttendees = showAttendees;
this.t = attendee.language.translate;
+
+ if (!this.showAttendees) {
+ this.calEvent.attendees = [this.attendee];
+ }
}
protected getiCalEventAsString(): string | undefined {
diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts
index a96d3a832ac..817c75f9ffe 100644
--- a/packages/features/bookings/lib/handleNewBooking.ts
+++ b/packages/features/bookings/lib/handleNewBooking.ts
@@ -552,6 +552,7 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
requiresConfirmation: requiresConfirmation ?? false,
eventTypeId: eventType.id,
seatsShowAttendees: !!eventType.seatsShowAttendees,
+ seatsPerTimeSlot: eventType.seatsPerTimeSlot,
};
// For seats, if the booking already exists then we want to add the new attendee to the existing booking
@@ -621,10 +622,6 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
const newSeat = booking.attendees.length !== 0;
- if (!evt.seatsShowAttendees) {
- evt.attendees = invitee;
- }
-
/**
* Remember objects are passed into functions as references
* so if you modify it in a inner function it will be modified in the outer function
diff --git a/packages/lib/CalEventParser.ts b/packages/lib/CalEventParser.ts
index 05b6816403c..5d18c8769e6 100644
--- a/packages/lib/CalEventParser.ts
+++ b/packages/lib/CalEventParser.ts
@@ -17,13 +17,21 @@ ${calEvent.type}
};
export const getWhen = (calEvent: CalendarEvent) => {
- return `
+ return calEvent.seatsPerTimeSlot
+ ? `
+${calEvent.organizer.language.translate("organizer_timezone")}:
+${calEvent.organizer.timeZone}
+ `
+ : `
${calEvent.organizer.language.translate("invitee_timezone")}:
${calEvent.attendees[0].timeZone}
`;
};
export const getWho = (calEvent: CalendarEvent) => {
+ if (calEvent.seatsPerTimeSlot && !calEvent.seatsShowAttendees) {
+ calEvent.attendees = [];
+ }
const attendees = calEvent.attendees
.map((attendee) => {
return `
diff --git a/packages/types/Calendar.d.ts b/packages/types/Calendar.d.ts
index 9141e80e34f..55e4b59779c 100644
--- a/packages/types/Calendar.d.ts
+++ b/packages/types/Calendar.d.ts
@@ -155,6 +155,7 @@ export interface CalendarEvent {
eventTypeId?: number | null;
appsStatus?: AppsStatus[];
seatsShowAttendees?: boolean | null;
+ seatsPerTimeSlot?: number | null;
}
export interface EntryPoint {