diff --git a/packages/emails/email-manager.ts b/packages/emails/email-manager.ts index aea2a3a706..b6bdc0e463 100644 --- a/packages/emails/email-manager.ts +++ b/packages/emails/email-manager.ts @@ -1,5 +1,7 @@ import type { TFunction } from "next-i18next"; +import type { EventNameObjectType } from "@calcom/core/event"; +import { getEventName } from "@calcom/core/event"; import type BaseEmail from "@calcom/emails/templates/_base-email"; import type { CalendarEvent, Person } from "@calcom/types/Calendar"; @@ -39,7 +41,7 @@ const sendEmail = (prepare: () => BaseEmail) => { }); }; -export const sendScheduledEmails = async (calEvent: CalendarEvent) => { +export const sendScheduledEmails = async (calEvent: CalendarEvent, eventNameObject?: EventNameObjectType) => { const emailsToSend: Promise[] = []; emailsToSend.push(sendEmail(() => new OrganizerScheduledEmail({ calEvent }))); @@ -52,7 +54,18 @@ export const sendScheduledEmails = async (calEvent: CalendarEvent) => { emailsToSend.push( ...calEvent.attendees.map((attendee) => { - return sendEmail(() => new AttendeeScheduledEmail(calEvent, attendee)); + return sendEmail( + () => + new AttendeeScheduledEmail( + { + ...calEvent, + ...(eventNameObject && { + title: getEventName({ ...eventNameObject, t: attendee.language.translate }), + }), + }, + attendee + ) + ); }) ); diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts index 8ee7959077..d372ece1b4 100644 --- a/packages/features/bookings/lib/handleNewBooking.ts +++ b/packages/features/bookings/lib/handleNewBooking.ts @@ -1267,12 +1267,15 @@ async function handler( videoCallUrl = metadata.hangoutLink || defaultLocationUrl || videoCallUrl; } if (noEmail !== true) { - await sendScheduledEmails({ - ...evt, - additionalInformation: metadata, - additionalNotes, - customInputs, - }); + await sendScheduledEmails( + { + ...evt, + additionalInformation: metadata, + additionalNotes, + customInputs, + }, + eventNameObject + ); } } }