feat: add option to disable sending transcription emails (#19065)

* feat: add option to disable sending transcription emails

* fix: types and tests

* fix: type error

* fix: type err

* fix: type err

---------

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-02-07 12:33:38 +00:00
1 parent 6ca76707da
commit 808de26401
17 files changed
+83 -30

No files matched your search

@@ -88,6 +88,7 @@ const getEventTypes = async (userId: number, teamIds?: number[]) => {
position: true,
recurringEvent: true,
requiresConfirmation: true,
canSendCalVideoTranscriptionEmails: true,
team: { select: { slug: true } },
schedulingType: true,
teamId: true,
+1
View File
@@ -30,6 +30,7 @@ export const getEventTypesFromDB = async (id: number) => {
eventName: true,
recurringEvent: true,
requiresConfirmation: true,
canSendCalVideoTranscriptionEmails: true,
userId: true,
successRedirectUrl: true,
customInputs: true,
+1
View File
@@ -21,6 +21,7 @@ export const getBooking = async (bookingId: number) => {
select: {
teamId: true,
parentId: true,
canSendCalVideoTranscriptionEmails: true,
},
},
user: {
@@ -158,6 +158,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const bookingReference = await getBookingReference(room);
const booking = await getBooking(bookingReference.bookingId as number);
if (!booking.eventType?.canSendCalVideoTranscriptionEmails) {
return res.status(200).json({
message: `Transcription emails are disabled for this event type ${booking.eventTypeId}`,
});
}
const transcripts = await getAllTranscriptsAccessLinkFromMeetingId(meeting_id);
if (!transcripts || !transcripts.length)
@@ -24,6 +24,8 @@
"verify_email_email_header": "Verify your email address",
"verify_email_email_button": "Verify email",
"cal_ai_assistant": "Cal AI Assistant",
"send_cal_video_transcription_emails": "Send Cal Video Transcription Emails",
"description_send_cal_video_transcription_emails": "Send emails with the transcription of the Cal Video after the meeting ends. (Requires a paid plan)",
"verify_email_change_description": "You have recently requested to change the email address you use to log into your {{appName}} account. Please click the button below to confirm your new email address.",
"verify_email_change_success_toast": "Updated your email to {{email}}",
"verify_email_change_failure_toast": "Failed to update email.",
@@ -64,6 +64,7 @@ type UserPageProps = {
| "hidden"
| "lockTimeZoneToggleOnBookingPage"
| "requiresConfirmation"
| "canSendCalVideoTranscriptionEmails"
| "requiresBookerEmailVerification"
| "price"
| "currency"