import dayjs, { Dayjs } from "dayjs"; import localizedFormat from "dayjs/plugin/localizedFormat"; import timezone from "dayjs/plugin/timezone"; import toArray from "dayjs/plugin/toArray"; import utc from "dayjs/plugin/utc"; import EventOrganizerMail from "@lib/emails/EventOrganizerMail"; dayjs.extend(utc); dayjs.extend(timezone); dayjs.extend(toArray); dayjs.extend(localizedFormat); export default class EventOrganizerRequestMail extends EventOrganizerMail { protected getBodyHeader(): string { return "A new event is waiting for your approval."; } protected getBodyText(): string { return "Check your bookings page to confirm or reject the booking."; } protected getAdditionalBody(): string { return `Confirm or reject the booking`; } protected getImage(): string { return ` `; } protected getSubject(): string { const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone); return `New event request: ${this.calEvent.attendees[0].name} - ${organizerStart.format( "LT dddd, LL" )} - ${this.calEvent.type}`; } }