Fix emails and cal event descriptions (#2634)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
alannncandkodiakhq[bot] authored and Omar López committed 2022-05-02 16:21:11 -06:00
1 parent 3256d601db
commit d856ef53a7
6 files changed
+17 -10

No files matched your search

@@ -5,6 +5,7 @@ import { v5 as uuidv5 } from "uuid";
import { getTranslation } from "@calcom/lib/server/i18n";
import prisma from "@calcom/prisma";
import { CalendarEvent } from "@calcom/types/Calendar";
import { CalendarEventClass } from "./class";
@@ -124,6 +125,7 @@ export class CalendarEventBuilder implements ICalendarEventBuilder {
slug: true,
},
},
description: true,
slug: true,
teamId: true,
title: true,
@@ -263,6 +265,10 @@ export class CalendarEventBuilder implements ICalendarEventBuilder {
this.calendarEvent.description = description;
}
public setNotes(notes: CalendarEvent["additionalNotes"]) {
this.calendarEvent.additionalNotes = notes;
}
public setCancellationReason(cancellationReason: CalendarEventClass["cancellationReason"]) {
this.calendarEvent.cancellationReason = cancellationReason;
}
@@ -21,6 +21,7 @@ class CalendarEventClass implements CalendarEvent {
cancellationReason?: string | null;
rejectionReason?: string | null;
hideCalendarNotes?: boolean;
additionalNotes?: string | null | undefined;
constructor(initProps?: CalendarEvent) {
// If more parameters are given we update this
@@ -27,6 +27,8 @@ export class CalendarEventDirector {
this.builder.setLocation(this.existingBooking.location);
this.builder.setUId(this.existingBooking.uid);
this.builder.setCancellationReason(this.cancellationReason);
this.builder.setDescription(this.builder.eventType.description);
this.builder.setNotes(this.existingBooking.description);
this.builder.buildRescheduleLink(this.existingBooking.uid);
} else {
throw new Error("buildForRescheduleEmail.missing.params.required");