2023-01-04 22:14:46 +00:00
|
|
|
import { APP_NAME } from "@calcom/lib/constants";
|
|
|
|
|
2022-06-06 17:49:56 +00:00
|
|
|
import { renderEmail } from "../";
|
|
|
|
import OrganizerScheduledEmail from "./organizer-scheduled-email";
|
|
|
|
|
|
|
|
export default class OrganizerRescheduledEmail extends OrganizerScheduledEmail {
|
|
|
|
protected getNodeMailerPayload(): Record<string, unknown> {
|
|
|
|
const toAddresses = [this.calEvent.organizer.email];
|
|
|
|
if (this.calEvent.team) {
|
|
|
|
this.calEvent.team.members.forEach((member) => {
|
|
|
|
const memberAttendee = this.calEvent.attendees.find((attendee) => attendee.name === member);
|
|
|
|
if (memberAttendee) {
|
|
|
|
toAddresses.push(memberAttendee.email);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
icalEvent: {
|
|
|
|
filename: "event.ics",
|
|
|
|
content: this.getiCalEventAsString(),
|
|
|
|
},
|
2023-01-04 22:14:46 +00:00
|
|
|
from: `${APP_NAME} <${this.getMailerOptions().from}>`,
|
2022-06-06 17:49:56 +00:00
|
|
|
to: toAddresses.join(","),
|
2022-09-15 01:27:46 +00:00
|
|
|
subject: `${this.calEvent.organizer.language.translate("event_type_has_been_rescheduled_on_time_date", {
|
2023-01-10 18:32:50 +00:00
|
|
|
title: this.calEvent.title,
|
2022-06-06 17:49:56 +00:00
|
|
|
date: `${this.getOrganizerStart("h:mma")} - ${this.getOrganizerEnd(
|
|
|
|
"h:mma"
|
|
|
|
)}, ${this.calEvent.organizer.language.translate(
|
|
|
|
this.getOrganizerStart("dddd").toLowerCase()
|
|
|
|
)}, ${this.calEvent.organizer.language.translate(
|
|
|
|
this.getOrganizerStart("MMMM").toLowerCase()
|
|
|
|
)} ${this.getOrganizerStart("D")}, ${this.getOrganizerStart("YYYY")}`,
|
|
|
|
})}`,
|
|
|
|
html: renderEmail("OrganizerRescheduledEmail", {
|
|
|
|
calEvent: this.calEvent,
|
|
|
|
attendee: this.calEvent.organizer,
|
|
|
|
}),
|
|
|
|
text: this.getTextBody("event_has_been_rescheduled"),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|