mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* refactor: apply biome formatting to small packages + packages/lib Format packages/sms, packages/prisma, packages/platform/libraries, packages/platform/examples, packages/platform/types, packages/emails, and packages/lib. Excludes packages/platform/examples/base/src/pages/[bookingUid].tsx due to pre-existing lint errors. Co-Authored-By: Claude Opus 4.6 <[email protected]> * revert: remove packages/platform formatting changes Revert biome formatting for packages/platform as requested. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { WEBAPP_URL } from "@calcom/lib/constants";
|
|
import type { CalendarEvent, Person } from "@calcom/types/Calendar";
|
|
|
|
import SMSManager from "../sms-manager";
|
|
|
|
export default class EventCancelledSMS extends SMSManager {
|
|
constructor(calEvent: CalendarEvent) {
|
|
super(calEvent);
|
|
}
|
|
|
|
getMessage(attendee: Person) {
|
|
const t = attendee.language.translate;
|
|
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`;
|
|
|
|
const messageText = `${t("hey_there")} ${attendee.name}, ${t("event_request_cancelled")}\n\n${t(
|
|
"event_cancelled_subject",
|
|
{
|
|
title: typeof this.calEvent.title === "string" ? this.calEvent.title : "Untitled Event",
|
|
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
|
|
interpolation: { escapeValue: false },
|
|
}
|
|
)}`;
|
|
|
|
const urlText = t("you_can_view_booking_details_with_this_url", {
|
|
url: bookingUrl,
|
|
interpolation: { escapeValue: false },
|
|
});
|
|
|
|
return `${messageText}\n\n${urlText}`;
|
|
}
|
|
}
|