Skip to content

Commit 1d95c1d

Browse files
committed
fix: Mails are sent to the organizer twice
The `ics` package doesn't support setting the `SCHEDULE-AGENT` parameter, there is a PR (adamgibbons/ics#248), but it is not merged. This is a workaround that relies on the fact that the `ics` package does not properly escape the `name` field of the organizer. In a perfect world, they would merge the PR and create a new release, but this is unfortunately not the world we live in. refs calcom#9485
1 parent d8f6400 commit 1d95c1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/lib/CalendarService.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ export default abstract class BaseCalendarService implements Calendar {
152152
title: event.title,
153153
description: getRichDescription(event),
154154
location: getLocation(event),
155-
organizer: { email: event.organizer.email, name: event.organizer.name },
155+
// TODO Use `name`, `email`, and `scheduleAgent` once https://github.com/adamgibbons/ics/pull/248 is merged
156+
organizer: { name: event.organizer.name + ":MAILTO:" + event.organizer.email + ":SCHEDULE-AGENT=CLIENT" },
156157
attendees: this.getAttendees(event),
157158
/** according to https://datatracker.ietf.org/doc/html/rfc2446#section-3.2.1, in a published iCalendar component.
158159
* "Attendees" MUST NOT be present
@@ -228,7 +229,8 @@ export default abstract class BaseCalendarService implements Calendar {
228229
title: event.title,
229230
description: getRichDescription(event),
230231
location: getLocation(event),
231-
organizer: { email: event.organizer.email, name: event.organizer.name },
232+
// TODO Use `name`, `email`, and `scheduleAgent` once https://github.com/adamgibbons/ics/pull/248 is merged
233+
organizer: { name: event.organizer.name + ":MAILTO:" + event.organizer.email + ":SCHEDULE-AGENT=CLIENT" },
232234
attendees: this.getAttendees(event),
233235
});
234236

0 commit comments

Comments
 (0)