feat : update

This commit is contained in:
2026-10-03 00:56:31 +07:00 Unverified
parent f71c00d2ab
commit f23b69a280
36 changed files with 766 additions and 376 deletions
+18
View File
@@ -0,0 +1,18 @@
import "server-only";
const FROM = "Buzz Guide <[email protected]>";
export async function sendAuthEmail(to: string, subject: string, text: string): Promise<void> {
const apiKey = process.env.RESEND_API_KEY;
if (!apiKey) throw new Error("RESEND_API_KEY is required for authentication email.");
const response = await fetch("https://api.resend.com/emails", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ from: FROM, to: [to], subject, text }),
});
if (!response.ok) throw new Error(`Authentication email delivery failed (${response.status}).`);
}