import { Resend } from "resend";
import { env } from "@/env";

const resend = new Resend(env.RESEND_API_KEY);

export async function sendEmail(input: { to: string; subject: string; html: string }) {
  const { error } = await resend.emails.send({ from: env.EMAIL_FROM, ...input });
  if (error) throw new Error(`Resend: ${error.message}`);
}
