Learn how to set up and use Resend for email delivery and React Email for beautiful email templates
Dirstarter uses Resend for email delivery and React Email for creating beautiful, responsive email templates. This combination provides a modern, developer-friendly way to handle email communications.
Resend is a modern email API that offers:
- High deliverability rates
- Real-time analytics
- Simple API
- TypeScript support
- Marketing email service
- Webhook support
- React Email integration
Setup
- Create a Resend account at resend.com
- Get your API key from the dashboard
- Add the following environment variables:
For more information on the available options and API endpoints, see the Resend documentation.
Transactional Emails
Usage
The boilerplate provides a simple email sending utility that supports both single and batch sending:
This utility also creates a text-only version of the email for clients that don't support HTML.
React Email
React Email allows you to create beautiful, responsive email templates using React components. The boilerplate includes several pre-built templates for different use cases:
Pre-built Templates
-
Authentication
login-link.tsx
- Passwordless authentication emails
-
Tool Management
tool-published.tsx
- Notification when a tool is publishedtool-scheduled.tsx
- Confirmation when a tool is scheduledtool-claim-otp.tsx
- OTP verification for tool claimstool-expedite-reminder.tsx
- Reminder for expedited submissions
-
Submissions
submission.tsx
- Confirmation for new tool submissionssubmission-expedited.tsx
- Admin notification for expedited submissions
Creating Custom Templates
- Create a new template in the
emails
directory:
- Preview your template locally:
- Use the template in your code:
Email Components
The boilerplate includes reusable email components in emails/components/
that use Tailwind CSS for styling:
EmailWrapper
- Base wrapper component that provides consistent layout and stylingButton
- Styled button component with Tailwind classesContainer
- Responsive container with Tailwind classesFooter
- Standard footer with social links and Tailwind stylingHeader
- Email header with logo and Tailwind classesSection
- Content section with consistent spacing using Tailwind
Marketing Emails
Dirstarter offers a marketing email service that allows you to send newsletters to your audience. It provides:
- Newsletter subscription handling
- Email validation and spam prevention
- Subscriber analytics
- Admin dashboard integration
Admin Dashboard Integration
The admin dashboard includes a subscribers card that shows:
- Total subscribers
- Average daily subscriptions
- Subscription trends
Alternatives
While Resend is our recommended choice, here are some alternatives:
-
- Pros: Established, feature-rich
- Cons: More complex setup, higher pricing
-
- Pros: Good deliverability, developer-friendly
- Cons: Less modern API, more complex pricing
-
- Pros: Very cost-effective, high scalability
- Cons: Basic features, requires more setup
-
- Pros: Excellent deliverability, simple API
- Cons: Higher pricing, fewer features
-
- Pros: Affordable, privacy-focused, open source
- Cons: Developer experience is not as good as Resend
Last updated on