Fix request reschedule organiser email (#3227)

* Fix request reschedule organizer email

* Updated book a new time link and removed manage or cancel action on user owner email request reschedule

* Fix let with const for a variable and change env var to a constant from lib

Co-authored-by: Omar López <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-07-07 16:25:05 -06:00
1 parent 2c30976e99
commit 6b0ac96b38
5 files changed
+22 -9

No files matched your search

@@ -1,8 +1,9 @@
import { Prisma, Booking } from "@prisma/client";
import dayjs from "@calcom/dayjs";
import short from "short-uuid";
import { v5 as uuidv5 } from "uuid";
import dayjs from "@calcom/dayjs";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { getTranslation } from "@calcom/lib/server/i18n";
import prisma from "@calcom/prisma";
import { CalendarEvent } from "@calcom/types/Calendar";
@@ -70,7 +71,7 @@ export class CalendarEventBuilder implements ICalendarEventBuilder {
if (!this.eventType) {
throw new Error("exec BuildEventObjectFromInnerClass before calling this function");
}
let users = this.eventType.users;
const users = this.eventType.users;
/* If this event was pre-relationship migration */
if (!users.length && this.eventType.userId) {
@@ -314,8 +315,7 @@ export class CalendarEventBuilder implements ICalendarEventBuilder {
const queryParams = new URLSearchParams();
queryParams.set("rescheduleUid", `${booking.uid}`);
slug = `${slug}?${queryParams.toString()}`;
const rescheduleLink = `${process.env.NEXT_PUBLIC_WEBAPP_URL}/${slug}`;
const rescheduleLink = `${WEBAPP_URL}/${slug}?${queryParams.toString()}`;
this.rescheduleLink = rescheduleLink;
} catch (error) {
if (error instanceof Error) {
@@ -16,6 +16,7 @@ export const OrganizerRequestRescheduledEmail = (
}
headerType="calendarCircle"
subject="rescheduled_event_type_subject"
callToAction={null}
{...props}
/>
);
@@ -1,6 +1,7 @@
import { createEvent, DateArray, Person } from "ics";
import dayjs from "@calcom/dayjs";
import { getRichDescription } from "@calcom/lib/CalEventParser";
import { CalendarEvent } from "@calcom/types/Calendar";
import { renderEmail } from "../";
@@ -27,7 +28,7 @@ export default class OrganizerRequestRescheduledEmail extends OrganizerScheduled
name: this.calEvent.attendees[0].name,
date: this.getFormattedDate(),
})}`,
html: renderEmail("OrganizerScheduledEmail", {
html: renderEmail("OrganizerRequestRescheduledEmail", {
calEvent: this.calEvent,
attendee: this.calEvent.organizer,
}),
@@ -78,4 +79,15 @@ export default class OrganizerRequestRescheduledEmail extends OrganizerScheduled
}
return icsEvent.value;
}
// @OVERRIDE
protected getTextBody(title = "", subtitle = "", extraInfo = "", callToAction = ""): string {
return `
${this.t(title)}
${this.t(subtitle)}
${extraInfo}
${getRichDescription(this.calEvent)}
${callToAction}
`.trim();
}
}