cal/packages/emails/templates/monthly-digest-email.ts
Pradumn Kumar 786c1c2ba3
feat: monthly email digest (#10621)
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peer@cal.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-09-19 16:19:36 +02:00

25 lines
725 B
TypeScript

import { APP_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 getNodeMailerPayload(): Record<string, unknown> {
return {
from: `${APP_NAME} <${this.getMailerOptions().from}>`,
to: this.eventData.admin.email,
subject: `${APP_NAME}: Your monthly digest`,
html: renderEmail("MonthlyDigestEmail", this.eventData),
text: "",
};
}
}