import { Resend } from 'resend'; import { RESEND_API } from '$app/env/private'; const resend = new Resend(String(RESEND_API)); export async function sendPasswordResetEmail(opts: { to: string; resetLink: string; famName: string; }) { const { to, resetLink, famName } = opts; await resend.emails.send({ from: 'no-reply@famchamp.ai', to, subject: `Reset your password for ${famName}`, html: `

You requested a password reset for your ${famName} account.

Click here to reset your password

This link expires in 1 hour.

If you didn't request this, you can ignore this email.

` }); } export async function sendParentInviteEmail(opts: { to: string; inviteLink: string; famName: string; otp: string; }) { const { to, inviteLink, famName, otp } = opts; await resend.emails.send({ from: 'no-reply@famchamp.ai', to, subject: `You're invited to ${famName} on FamDone`, html: `

You've been invited as a parent on ${famName}.

Click here to join and set up your password.

Your code is ${otp} (valid 20 minutes).

If you weren't expecting this, you can ignore this email.

` }); }