fix: temporarily disable sms/whatsapp to attendee workflow action (#10485)

* disable sms and whatsapp to attendee

* fix type error

* fix prisma enum imports

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-07-31 17:45:48 +00:00
1 parent 9498ad4916
commit fcd8de43d6
4 files changed
+26 -6

No files matched your search

@@ -134,7 +134,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
);
}
if (message?.length && message?.length > 0 && sendTo) {
if (
message?.length &&
message?.length > 0 &&
sendTo &&
reminder.workflowStep.action !== WorkflowActions.SMS_ATTENDEE
) {
const scheduledSMS = await twilio.scheduleSMS(sendTo, message, reminder.scheduledDate, senderID);
await prisma.workflowReminder.update({
@@ -1,11 +1,11 @@
/* Schedule any workflow reminder that falls within 7 days for WHATSAPP */
import { WorkflowActions, WorkflowMethods } from "@prisma/client";
import type { NextApiRequest, NextApiResponse } from "next";
import dayjs from "@calcom/dayjs";
import { defaultHandler } from "@calcom/lib/server";
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
import prisma from "@calcom/prisma";
import { WorkflowActions, WorkflowMethods } from "@calcom/prisma/enums";
import { getWhatsappTemplateFunction } from "../lib/actionHelperFunctions";
import * as twilio from "../lib/reminders/smsProviders/twilioProvider";
@@ -90,7 +90,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
userName
);
if (message?.length && message?.length > 0 && sendTo) {
if (
message?.length &&
message?.length > 0 &&
sendTo &&
reminder.workflowStep.action !== WorkflowActions.WHATSAPP_ATTENDEE
) {
const scheduledSMS = await twilio.scheduleSMS(sendTo, message, reminder.scheduledDate, "", true);
await prisma.workflowReminder.update({