fix: rescheduling round robin events (emails and calendar events) (#12469)
* send the correct booking email for round robin rescheduling * fixing originalBookingMemberEmails * fix calendar event (needs some code refactoring) * refactor rescheduling code * code clean up * add comment * fix event name if host changes * add tests for rr rescheduling emails * fix videoCallUrl of google meet * code clean up * fix destinationCalendar for new booking --------- Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
1 parent
c9b50ffb78
commit
230b82d3bf
5 files changed
+1912
-1333
No files matched your search
@@ -102,6 +102,37 @@ export const sendScheduledEmails = async (
|
||||
await Promise.all(emailsToSend);
|
||||
};
|
||||
|
||||
// for rescheduled round robin booking that assigned new members
|
||||
export const sendRoundRobinScheduledEmails = async (calEvent: CalendarEvent, members: Person[]) => {
|
||||
const emailsToSend: Promise<unknown>[] = [];
|
||||
|
||||
for (const teamMember of members) {
|
||||
emailsToSend.push(sendEmail(() => new OrganizerScheduledEmail({ calEvent, teamMember })));
|
||||
}
|
||||
|
||||
await Promise.all(emailsToSend);
|
||||
};
|
||||
|
||||
export const sendRoundRobinRescheduledEmails = async (calEvent: CalendarEvent, members: Person[]) => {
|
||||
const emailsToSend: Promise<unknown>[] = [];
|
||||
|
||||
for (const teamMember of members) {
|
||||
emailsToSend.push(sendEmail(() => new OrganizerRescheduledEmail({ calEvent, teamMember })));
|
||||
}
|
||||
|
||||
await Promise.all(emailsToSend);
|
||||
};
|
||||
|
||||
export const sendRoundRobinCancelledEmails = async (calEvent: CalendarEvent, members: Person[]) => {
|
||||
const emailsToSend: Promise<unknown>[] = [];
|
||||
|
||||
for (const teamMember of members) {
|
||||
emailsToSend.push(sendEmail(() => new OrganizerCancelledEmail({ calEvent, teamMember })));
|
||||
}
|
||||
|
||||
await Promise.all(emailsToSend);
|
||||
};
|
||||
|
||||
export const sendRescheduledEmails = async (calEvent: CalendarEvent) => {
|
||||
const emailsToSend: Promise<unknown>[] = [];
|
||||
|
||||
|
||||
Reference in new issue
Block a user