Features Overview
Send emails and notifications to your users.
Note: This is mock/placeholder content for demonstration purposes.
The application includes email functionality for transactional messages and user notifications.
Email Configuration
Supabase Email (Default)
By default, emails are sent through Supabase:
- Authentication emails (sign-up, password reset, magic links)
- Email verification
- Email change confirmation
Custom SMTP
For transactional emails, configure your own SMTP provider:
# .env SMTP_HOST=smtp.example.com SMTP_PORT=587 SMTP_USER=your-username SMTP_PASSWORD=your-password [email protected] SMTP_FROM_NAME=Your App Name
Sending Emails
Using the Email Service
import { sendEmail } from '~/lib/email/send-email';
await sendEmail({
to: '[email protected]',
subject: 'Welcome to Our App',
html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
});
Using Email Templates
Create reusable email templates:
// lib/email/templates/welcome-email.tsx
import { EmailTemplate } from '~/lib/email/email-template';
interface WelcomeEmailProps {
name: string;
loginUrl: string;
}
export function WelcomeEmail({ name, loginUrl }: WelcomeEmailProps) {
return (
<EmailTemplate>
<h1>Welcome, {name}!</h1>
<p>We're excited to have you on board.</p>
<a href={loginUrl}>Get Started</a>
</EmailTemplate>
);
}
// Send the email
import { render } from '@react-email/render';
import { WelcomeEmail } from '~/lib/email/templates/welcome-email';
const html = render(
<WelcomeEmail name="John" loginUrl="https://app.com/login" />
);
await sendEmail({
to: '[email protected]',
subject: 'Welcome to Our App',
html,
});
Email Types
Transactional Emails
Emails triggered by user actions:
- Welcome emails
- Order confirmations
- Password resets
- Account notifications
- Billing updates
Marketing Emails
Promotional and engagement emails:
- Product updates
- Feature announcements
- Newsletters
- Onboarding sequences
Email Providers
Recommended Providers
Resend - Developer-friendly email API
npm install resend
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: '[email protected]',
to: '[email protected]',
subject: 'Welcome',
html: emailHtml,
});