We use Resend for transactional and marketing emails.
Configuration
- Create an account at Resend.
- Verify your domain (required for sending to non-test emails).
- Create an API Key.
- Add it to
.env:
RESEND_API_KEY=re_123456789
NEXT_PUBLIC_SUPPORT_MAIL=support@yourdomain.com
Sending Emails
We use React Email for templates. You can send an email using the @workspace/email package:
import { sendEmail } from "@workspace/email";
import { WelcomeEmail } from "@workspace/email/templates/welcome";
await sendEmail({
to: "user@example.com",
subject: "Welcome!",
react: WelcomeEmail({ name: "User" }),
});
