fix: new reassignment email for RR host reassignment (#17279)
* add new reassignment email * improve reassign email * fixes * Minor copy fixup --------- Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
11 files changed
+103
-18
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { EMAIL_FROM_NAME } from "@calcom/lib/constants";
|
||||
|
||||
import { renderEmail } from "../";
|
||||
import generateIcsFile, { GenerateIcsRole } from "../lib/generateIcsFile";
|
||||
import OrganizerScheduledEmail from "./organizer-scheduled-email";
|
||||
|
||||
export default class OrganizerReassignedEmail extends OrganizerScheduledEmail {
|
||||
protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {
|
||||
const toAddresses = [this.teamMember?.email || this.calEvent.organizer.email];
|
||||
|
||||
return {
|
||||
icalEvent: generateIcsFile({
|
||||
calEvent: this.calEvent,
|
||||
status: "CANCELLED",
|
||||
role: GenerateIcsRole.ORGANIZER,
|
||||
}),
|
||||
from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,
|
||||
to: toAddresses.join(","),
|
||||
subject: `${this.t("event_reassigned_subject", {
|
||||
title: this.calEvent.title,
|
||||
date: this.getFormattedDate(),
|
||||
})}`,
|
||||
html: await renderEmail("OrganizerReassignedEmail", {
|
||||
attendee: this.calEvent.organizer,
|
||||
calEvent: this.calEvent,
|
||||
reassignedTo: this.reassignedTo,
|
||||
}),
|
||||
text: this.getTextBody("event_request_reassigned"),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,21 @@ export default class OrganizerScheduledEmail extends BaseEmail {
|
||||
t: TFunction;
|
||||
newSeat?: boolean;
|
||||
teamMember?: Person;
|
||||
reassignedTo?: { name: string | null; email: string };
|
||||
|
||||
constructor(input: { calEvent: CalendarEvent; newSeat?: boolean; teamMember?: Person }) {
|
||||
constructor(input: {
|
||||
calEvent: CalendarEvent;
|
||||
newSeat?: boolean;
|
||||
teamMember?: Person;
|
||||
reassignedTo?: { email: string; name: string | null };
|
||||
}) {
|
||||
super();
|
||||
this.name = "SEND_BOOKING_CONFIRMATION";
|
||||
this.calEvent = input.calEvent;
|
||||
this.t = this.calEvent.organizer.language.translate;
|
||||
this.newSeat = input.newSeat;
|
||||
this.teamMember = input.teamMember;
|
||||
this.reassignedTo = input.reassignedTo;
|
||||
}
|
||||
|
||||
protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {
|
||||
|
||||
Reference in new issue
Block a user