auth: extract reusable sendVerificationEmail utility, enable sendOnSignUp
- Create src/lib/server/email-verification.ts with exported utility function - Use it in auth.ts sendVerificationEmail callback - Enable sendOnSignUp so verification email is sent on registration
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { sendMail } from './resend';
|
||||
|
||||
export async function sendVerificationEmail(options: {
|
||||
email: string;
|
||||
verificationUrl: string;
|
||||
}) {
|
||||
await sendMail({
|
||||
to: options.email,
|
||||
templateId: 'email-verification-email',
|
||||
data: {
|
||||
target_email_address: options.email,
|
||||
verification_link: options.verificationUrl
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user