Refactored EventOwner to EventOrganizer
This commit is contained in:
parent
9e9ffdd656
commit
c662c97d14
5 changed files with 17 additions and 17 deletions
|
@ -1,8 +1,8 @@
|
||||||
import EventOwnerMail from "./emails/EventOwnerMail";
|
import EventOrganizerMail from "./emails/EventOrganizerMail";
|
||||||
import EventAttendeeMail from "./emails/EventAttendeeMail";
|
import EventAttendeeMail from "./emails/EventAttendeeMail";
|
||||||
import {v5 as uuidv5} from 'uuid';
|
import {v5 as uuidv5} from 'uuid';
|
||||||
import short from 'short-uuid';
|
import short from 'short-uuid';
|
||||||
import EventOwnerRescheduledMail from "./emails/EventOwnerRescheduledMail";
|
import EventOrganizerRescheduledMail from "./emails/EventOrganizerRescheduledMail";
|
||||||
import EventAttendeeRescheduledMail from "./emails/EventAttendeeRescheduledMail";
|
import EventAttendeeRescheduledMail from "./emails/EventAttendeeRescheduledMail";
|
||||||
|
|
||||||
const translator = short();
|
const translator = short();
|
||||||
|
@ -336,9 +336,9 @@ const createEvent = async (credential, calEvent: CalendarEvent): Promise<any> =>
|
||||||
|
|
||||||
const creationResult = credential ? await calendars([credential])[0].createEvent(calEvent) : null;
|
const creationResult = credential ? await calendars([credential])[0].createEvent(calEvent) : null;
|
||||||
|
|
||||||
const ownerMail = new EventOwnerMail(calEvent, uid);
|
const organizerMail = new EventOrganizerMail(calEvent, uid);
|
||||||
const attendeeMail = new EventAttendeeMail(calEvent, uid);
|
const attendeeMail = new EventAttendeeMail(calEvent, uid);
|
||||||
await ownerMail.sendEmail();
|
await organizerMail.sendEmail();
|
||||||
|
|
||||||
if (!creationResult || !creationResult.disableConfirmationEmail) {
|
if (!creationResult || !creationResult.disableConfirmationEmail) {
|
||||||
await attendeeMail.sendEmail();
|
await attendeeMail.sendEmail();
|
||||||
|
@ -355,9 +355,9 @@ const updateEvent = async (credential, uidToUpdate: String, calEvent: CalendarEv
|
||||||
|
|
||||||
const updateResult = credential ? await calendars([credential])[0].updateEvent(uidToUpdate, calEvent) : null;
|
const updateResult = credential ? await calendars([credential])[0].updateEvent(uidToUpdate, calEvent) : null;
|
||||||
|
|
||||||
const ownerMail = new EventOwnerRescheduledMail(calEvent, newUid);
|
const organizerMail = new EventOrganizerRescheduledMail(calEvent, newUid);
|
||||||
const attendeeMail = new EventAttendeeRescheduledMail(calEvent, newUid);
|
const attendeeMail = new EventAttendeeRescheduledMail(calEvent, newUid);
|
||||||
await ownerMail.sendEmail();
|
await organizerMail.sendEmail();
|
||||||
|
|
||||||
if (!updateResult || !updateResult.disableConfirmationEmail) {
|
if (!updateResult || !updateResult.disableConfirmationEmail) {
|
||||||
await attendeeMail.sendEmail();
|
await attendeeMail.sendEmail();
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {createEvent} from "ics";
|
||||||
import dayjs, {Dayjs} from "dayjs";
|
import dayjs, {Dayjs} from "dayjs";
|
||||||
import EventMail from "./EventMail";
|
import EventMail from "./EventMail";
|
||||||
|
|
||||||
export default class EventOwnerMail extends EventMail {
|
export default class EventOrganizerMail extends EventMail {
|
||||||
/**
|
/**
|
||||||
* Returns the instance's event as an iCal event in string representation.
|
* Returns the instance's event as an iCal event in string representation.
|
||||||
* @protected
|
* @protected
|
|
@ -1,7 +1,7 @@
|
||||||
import dayjs, {Dayjs} from "dayjs";
|
import dayjs, {Dayjs} from "dayjs";
|
||||||
import EventOwnerMail from "./EventOwnerMail";
|
import EventOrganizerMail from "./EventOrganizerMail";
|
||||||
|
|
||||||
export default class EventOwnerRescheduledMail extends EventOwnerMail {
|
export default class EventOrganizerRescheduledMail extends EventOrganizerMail {
|
||||||
/**
|
/**
|
||||||
* Returns the email text as HTML representation.
|
* Returns the email text as HTML representation.
|
||||||
*
|
*
|
|
@ -1,9 +1,9 @@
|
||||||
import {CalendarEvent} from "../calendarClient";
|
import {CalendarEvent} from "../calendarClient";
|
||||||
import EventOwnerMail from "./EventOwnerMail";
|
import EventOrganizerMail from "./EventOrganizerMail";
|
||||||
import {VideoCallData} from "../videoClient";
|
import {VideoCallData} from "../videoClient";
|
||||||
import {getFormattedMeetingId, getIntegrationName} from "./helpers";
|
import {getFormattedMeetingId, getIntegrationName} from "./helpers";
|
||||||
|
|
||||||
export default class VideoEventOwnerMail extends EventOwnerMail {
|
export default class VideoEventOrganizerMail extends EventOrganizerMail {
|
||||||
videoCallData: VideoCallData;
|
videoCallData: VideoCallData;
|
||||||
|
|
||||||
constructor(calEvent: CalendarEvent, uid: string, videoCallData: VideoCallData) {
|
constructor(calEvent: CalendarEvent, uid: string, videoCallData: VideoCallData) {
|
|
@ -1,11 +1,11 @@
|
||||||
import prisma from "./prisma";
|
import prisma from "./prisma";
|
||||||
import {CalendarEvent} from "./calendarClient";
|
import {CalendarEvent} from "./calendarClient";
|
||||||
import VideoEventOwnerMail from "./emails/VideoEventOwnerMail";
|
import VideoEventOrganizerMail from "./emails/VideoEventOrganizerMail";
|
||||||
import VideoEventAttendeeMail from "./emails/VideoEventAttendeeMail";
|
import VideoEventAttendeeMail from "./emails/VideoEventAttendeeMail";
|
||||||
import {v5 as uuidv5} from 'uuid';
|
import {v5 as uuidv5} from 'uuid';
|
||||||
import short from 'short-uuid';
|
import short from 'short-uuid';
|
||||||
import EventAttendeeRescheduledMail from "./emails/EventAttendeeRescheduledMail";
|
import EventAttendeeRescheduledMail from "./emails/EventAttendeeRescheduledMail";
|
||||||
import EventOwnerRescheduledMail from "./emails/EventOwnerRescheduledMail";
|
import EventOrganizerRescheduledMail from "./emails/EventOrganizerRescheduledMail";
|
||||||
|
|
||||||
const translator = short();
|
const translator = short();
|
||||||
|
|
||||||
|
@ -191,9 +191,9 @@ const createMeeting = async (credential, calEvent: CalendarEvent): Promise<any>
|
||||||
url: creationResult.join_url,
|
url: creationResult.join_url,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ownerMail = new VideoEventOwnerMail(calEvent, uid, videoCallData);
|
const organizerMail = new VideoEventOrganizerMail(calEvent, uid, videoCallData);
|
||||||
const attendeeMail = new VideoEventAttendeeMail(calEvent, uid, videoCallData);
|
const attendeeMail = new VideoEventAttendeeMail(calEvent, uid, videoCallData);
|
||||||
await ownerMail.sendEmail();
|
await organizerMail.sendEmail();
|
||||||
|
|
||||||
if (!creationResult || !creationResult.disableConfirmationEmail) {
|
if (!creationResult || !creationResult.disableConfirmationEmail) {
|
||||||
await attendeeMail.sendEmail();
|
await attendeeMail.sendEmail();
|
||||||
|
@ -214,9 +214,9 @@ const updateMeeting = async (credential, uidToUpdate: String, calEvent: Calendar
|
||||||
|
|
||||||
const updateResult = credential ? await videoIntegrations([credential])[0].updateMeeting(uidToUpdate, calEvent) : null;
|
const updateResult = credential ? await videoIntegrations([credential])[0].updateMeeting(uidToUpdate, calEvent) : null;
|
||||||
|
|
||||||
const ownerMail = new EventOwnerRescheduledMail(calEvent, newUid);
|
const organizerMail = new EventOrganizerRescheduledMail(calEvent, newUid);
|
||||||
const attendeeMail = new EventAttendeeRescheduledMail(calEvent, newUid);
|
const attendeeMail = new EventAttendeeRescheduledMail(calEvent, newUid);
|
||||||
await ownerMail.sendEmail();
|
await organizerMail.sendEmail();
|
||||||
|
|
||||||
if (!updateResult || !updateResult.disableConfirmationEmail) {
|
if (!updateResult || !updateResult.disableConfirmationEmail) {
|
||||||
await attendeeMail.sendEmail();
|
await attendeeMail.sendEmail();
|
||||||
|
|
Loading…
Reference in a new issue