2
0
Files
cal/calcom/packages/emails/templates/monthly-digest-email.ts
2024-08-09 00:39:27 +02:00

25 lines
770 B
TypeScript

import { APP_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";
import { renderEmail } from "../";
import type { MonthlyDigestEmailData } from "../src/templates/MonthlyDigestEmail";
import BaseEmail from "./_base-email";
export default class MonthlyDigestEmail extends BaseEmail {
eventData: MonthlyDigestEmailData;
constructor(eventData: MonthlyDigestEmailData) {
super();
this.eventData = eventData;
}
protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {
return {
from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,
to: this.eventData.admin.email,
subject: `${APP_NAME}: Your monthly digest`,
html: await renderEmail("MonthlyDigestEmail", this.eventData),
text: "",
};
}
}