Loading...
Loading...
Send transactional emails from templates using Resend API.
Fabrk uses Resend for transactional emails. Use it with Email Templates to send welcome emails, notifications, and receipts.
[WHAT YOU'LL INTEGRATE]:
1$# .env.local2$RESEND_API_KEY="re_your_api_key"3$EMAIL_FROM="noreply@yourdomain.com"
1import { Resend } from "resend";23const resend = new Resend(process.env.RESEND_API_KEY);45export async function sendWelcomeEmail(email: string, name: string) {6 await resend.emails.send({7 from: process.env.EMAIL_FROM!,8 to: email,9 subject: "Welcome to Fabrk!",10 html: `<h1>Welcome, ${name}!</h1><p>Thanks for signing up.</p>`,11 });12}
Import email templates from Email Templates page:
1import { WelcomeEmail } from "@/emails/welcome";23await resend.emails.send({4 from: process.env.EMAIL_FROM!,5 to: user.email,6 subject: "Welcome!",7 react: WelcomeEmail({ name: user.name }),8});