Scheduling infrastructure for absolutely everyone.
don't send scheduled (#6072)
Carina Wollendorferc39a7dba85ca
diff --git a/packages/features/ee/workflows/api/scheduleEmailReminders.ts b/packages/features/ee/workflows/api/scheduleEmailReminders.tsindex 68003ddf192..3bce1c061bf 100644--- a/packages/features/ee/workflows/api/scheduleEmailReminders.ts+++ b/packages/features/ee/workflows/api/scheduleEmailReminders.ts@@ -147,16 +147,18 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {const batchId = batchIdResponse[1].batch_id;- await sgMail.send({- to: sendTo,- from: senderEmail,- subject: emailContent.emailSubject,- text: emailContent.emailBody.text,- html: emailContent.emailBody.html,- batchId: batchId,- sendAt: dayjs(reminder.scheduledDate).unix(),- replyTo: reminder.booking?.user?.email || senderEmail,- });+ if (reminder.workflowStep.action !== WorkflowActions.EMAIL_ADDRESS) {+ await sgMail.send({+ to: sendTo,+ from: senderEmail,+ subject: emailContent.emailSubject,+ text: emailContent.emailBody.text,+ html: emailContent.emailBody.html,+ batchId: batchId,+ sendAt: dayjs(reminder.scheduledDate).unix(),+ replyTo: reminder.booking?.user?.email || senderEmail,+ });+ }await prisma.workflowReminder.update({where: {