feat: add feature flag for sending workflow emails with smtp (#21187)
* add feature flag * add unit tests --------- Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
1 parent
50173658f8
commit
80fa172f79
12 files changed
+165
-7
No files matched your search
@@ -40,7 +40,7 @@ export async function handler(req: NextRequest) {
|
||||
return NextResponse.json({ message: "Not authenticated" }, { status: 401 });
|
||||
}
|
||||
|
||||
const isSendgridEnabled = process.env.SENDGRID_API_KEY && process.env.SENDGRID_EMAIL;
|
||||
const isSendgridEnabled = !!(process.env.SENDGRID_API_KEY && process.env.SENDGRID_EMAIL);
|
||||
|
||||
if (isSendgridEnabled) {
|
||||
const remindersToDelete: { referenceId: string | null; id: number }[] = await getAllRemindersToDelete();
|
||||
@@ -65,9 +65,7 @@ export async function handler(req: NextRequest) {
|
||||
});
|
||||
|
||||
await Promise.allSettled(handlePastCancelledReminders);
|
||||
}
|
||||
|
||||
if (isSendgridEnabled) {
|
||||
//cancel reminders for cancelled/rescheduled bookings that are scheduled within the next hour
|
||||
const remindersToCancel: { referenceId: string | null; id: number }[] = await getAllRemindersToCancel();
|
||||
|
||||
|
||||
Reference in new issue
Block a user