2
0

👷 Add email alert hourly sender

Closes #549
This commit is contained in:
Baptiste Arnaud
2023-06-06 13:25:13 +02:00
parent 40ef934740
commit a4cb6face8
16 changed files with 797 additions and 125 deletions

View File

@ -11,7 +11,6 @@ import { sendTelemetryEvents } from '@typebot.io/lib/telemetry/sendTelemetryEven
import { Workspace } from '@typebot.io/schemas'
const prisma = new PrismaClient()
const LIMIT_EMAIL_TRIGGER_PERCENT = 0.8
type WorkspaceForDigest = Pick<
Workspace,
@ -170,18 +169,6 @@ const sendAlertIfLimitReached = async (
)
continue
}
// if (
// chatsLimit > 0 &&
// totalChatsUsed >= chatsLimit * LIMIT_EMAIL_TRIGGER_PERCENT
// )
// await sendAlmostReachedChatsLimitEmail({
// to: workspace.members
// .map((member) => member.user.email)
// .filter(isDefined),
// usagePercent: Math.round((totalChatsUsed / chatsLimit) * 100),
// chatsLimit,
// url: `https://app.typebot.io/typebots?workspaceId=${workspace.id}`,
// })
}
return events
}