import { AdditionInformation } from "@lib/emails/EventMail";
import { CalendarEvent } from "../calendarClient";
import { VideoCallData } from "../videoClient";
import EventOrganizerMail from "./EventOrganizerMail";
import { getFormattedMeetingId, getIntegrationName } from "./helpers";
export default class VideoEventOrganizerMail extends EventOrganizerMail {
videoCallData: VideoCallData;
constructor(
calEvent: CalendarEvent,
uid: string,
videoCallData: VideoCallData,
additionInformation: AdditionInformation = null
) {
super(calEvent, uid);
this.videoCallData = videoCallData;
this.additionInformation = additionInformation;
}
/**
* Adds the video call information to the mail body
* and calendar event description.
*
* @protected
*/
protected getAdditionalBody(): string {
const meetingPassword = this.videoCallData.password;
const meetingId = getFormattedMeetingId(this.videoCallData);
// This odd indentation is necessary because otherwise the leading tabs will be applied into the event description.
if (meetingPassword && meetingId) {
return `
Video call provider: ${getIntegrationName(this.videoCallData)}
Meeting ID: ${getFormattedMeetingId(this.videoCallData)}
Meeting Password: ${this.videoCallData.password}
Meeting URL: ${this.videoCallData.url}
`;
}
return `
Video call provider: ${getIntegrationName(this.videoCallData)}
Meeting URL: ${this.videoCallData.url}
`;
}
}