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 this.calEvent.language("event_awaiting_approval");
}
protected getBodyText(): string {
return this.calEvent.language("check_bookings_page_to_confirm_or_reject");
}
protected getAdditionalBody(): string {
return `${this.calEvent.language(
"confirm_or_reject_booking"
)}`;
}
protected getImage(): string {
return ``;
}
protected getSubject(): string {
const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
return this.calEvent.language("new_event_request", {
attendeeName: this.calEvent.attendees[0].name,
date: organizerStart.format("LT dddd, LL"),
eventType: this.calEvent.type,
});
}
}