Files
calendar/packages/emails/templates/organizer-request-reminder-email.ts
T
3e10e2db36 feat: adds env variable for email sender name (#15598)
* feat: adds env variable for email sender name

* update env declaration file

---------

Co-authored-by: unknown <adhabal2002@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2024-06-27 18:25:13 -03:00

26 lines
993 B
TypeScript

import { EMAIL_FROM_NAME } from "@calcom/lib/constants";
import { renderEmail } from "../";
import OrganizerRequestEmail from "./organizer-request-email";
export default class OrganizerRequestReminderEmail extends OrganizerRequestEmail {
protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {
const toAddresses = [this.teamMember?.email || this.calEvent.organizer.email];
return {
from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,
to: toAddresses.join(","),
replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],
subject: `${this.t("event_awaiting_approval_subject", {
title: this.calEvent.title,
date: this.getFormattedDate(),
})}`,
html: await renderEmail("OrganizerRequestReminderEmail", {
calEvent: this.calEvent,
attendee: this.calEvent.organizer,
}),
text: this.getTextBody("event_still_awaiting_approval"),
};
}
}