don't send scheduled (#6072)

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2022-12-16 22:58:43 +00:00
1 parent fd37397e5c
commit c39a7dba85
1 file changed
+12 -10
@@ -147,16 +147,18 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const batchId = batchIdResponse[1].batch_id; const batchId = batchIdResponse[1].batch_id;
await sgMail.send({ if (reminder.workflowStep.action !== WorkflowActions.EMAIL_ADDRESS) {
to: sendTo, await sgMail.send({
from: senderEmail, to: sendTo,
subject: emailContent.emailSubject, from: senderEmail,
text: emailContent.emailBody.text, subject: emailContent.emailSubject,
html: emailContent.emailBody.html, text: emailContent.emailBody.text,
batchId: batchId, html: emailContent.emailBody.html,
sendAt: dayjs(reminder.scheduledDate).unix(), batchId: batchId,
replyTo: reminder.booking?.user?.email || senderEmail, sendAt: dayjs(reminder.scheduledDate).unix(),
}); replyTo: reminder.booking?.user?.email || senderEmail,
});
}
await prisma.workflowReminder.update({ await prisma.workflowReminder.update({
where: { where: {