import BaseEmail from "@lib/emails/templates/_base-email"; import { emailHead, emailBodyLogo } from "./common"; export interface Feedback { userId: number; rating: string; comment: string; } export default class FeedbackEmail extends BaseEmail { feedback: Feedback; constructor(feedback: Feedback) { super(); this.feedback = feedback; } protected getNodeMailerPayload(): Record { return { from: `Cal.com <${this.getMailerOptions().from}>`, to: process.env.SEND_FEEDBACK_EMAIL, subject: `User Feedback`, html: this.getHtmlBody(), text: this.getTextBody(), }; } protected getTextBody(): string { return ` userId: ${this.feedback.userId} rating: ${this.feedback.rating} comment: ${this.feedback.comment} `; } protected getHtmlBody(): string { return ` ${emailHead("Feedback")}
Feedback

Used id

${ this.feedback.userId }

Rating

${ this.feedback.rating }

Comment

${ this.feedback.comment }

${emailBodyLogo()}
`; } }