Email Configuration
The Ellemment Stack uses Resend as its email service provider, offering reliable email delivery with a generous free tier and simple API integration.
Development Environment
During development:
- Emails are logged to the terminal
- No real emails are sent
- Email contents are easily debuggable
- No environment variables required
Production Setup
API Key Configuration
-
Create a Resend API Key:
- Visit Resend API Keys
- Generate a new API key
- Copy the key value
-
Configure Production Environment:
fly secrets set RESEND_API_KEY="your_api_key_here" --app [YOUR_APP_NAME]
-
Configure Staging Environment:
fly secrets set RESEND_API_KEY="your_api_key_here" --app [YOUR_APP_NAME]-staging
Custom Domain Configuration
-
Set up a Custom Sending Domain:
- Visit Resend Domains
- Add and verify your domain
- Follow DNS configuration steps
-
Update Application Settings:
- Modify
app/utils/email.server.ts
- Set the
from
email address to your verified domain - Update relevant test files if necessary
- Modify
Email Features
The email system supports:
-
Transactional Emails:
- User registration
- Password reset
- Email verification
- Account notifications
-
Email Templates:
- HTML and text versions
- Custom styling
- Dynamic content
- Responsive design
-
Error Handling:
- Delivery status tracking
- Bounce handling
- Error logging
- Retry logic
Best Practices
-
Email Content:
- Include both HTML and text versions
- Use responsive design
- Test across email clients
- Follow anti-spam guidelines
-
Security:
- Never expose API keys
- Validate email addresses
- Rate limit email sending
- Monitor for abuse
-
Development:
- Use environment-specific configurations
- Test email templates thoroughly
- Monitor delivery rates
- Handle edge cases
For more information about security considerations, check the security documentation.
For deployment configuration details, see the deployment guide.