17 lines
521 B
TypeScript
17 lines
521 B
TypeScript
import { env } from '$env/dynamic/private';
|
|
import { sendMail } from './resend';
|
|
|
|
export async function sendVerificationEmail(options: { email: string; token: string }) {
|
|
const verificationUrl = `${env.BETTER_AUTH_URL}/api/auth/verify-email?token=${options.token}&callbackURL=/login?verified=true`;
|
|
|
|
await sendMail({
|
|
to: options.email,
|
|
subject: 'Verify your email address',
|
|
templateId: 'email-verification-email',
|
|
data: {
|
|
target_email_address: options.email,
|
|
verification_link: verificationUrl
|
|
}
|
|
});
|
|
}
|