2
0
Files
bot/apps/builder/src/pages/api/auth/sendVerificationRequest.ts
2023-03-29 08:14:35 +02:00

15 lines
325 B
TypeScript

import { sendMagicLinkEmail } from '@typebot.io/emails'
type Props = {
identifier: string
url: string
}
export const sendVerificationRequest = async ({ identifier, url }: Props) => {
try {
await sendMagicLinkEmail({ url, to: identifier })
} catch (err) {
throw new Error(`Email(s) could not be sent`)
}
}