Documentation

Settings

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

  1. Create a Resend API Key:

  2. Configure Production Environment:

    fly secrets set RESEND_API_KEY="your_api_key_here" --app [YOUR_APP_NAME]
  3. Configure Staging Environment:

    fly secrets set RESEND_API_KEY="your_api_key_here" --app [YOUR_APP_NAME]-staging

Custom Domain Configuration

  1. Set up a Custom Sending Domain:

    • Visit Resend Domains
    • Add and verify your domain
    • Follow DNS configuration steps
  2. Update Application Settings:

    • Modify app/utils/email.server.ts
    • Set the from email address to your verified domain
    • Update relevant test files if necessary

Email Features

The email system supports:

  1. Transactional Emails:

    • User registration
    • Password reset
    • Email verification
    • Account notifications
  2. Email Templates:

    • HTML and text versions
    • Custom styling
    • Dynamic content
    • Responsive design
  3. Error Handling:

    • Delivery status tracking
    • Bounce handling
    • Error logging
    • Retry logic

Best Practices

  1. Email Content:

    • Include both HTML and text versions
    • Use responsive design
    • Test across email clients
    • Follow anti-spam guidelines
  2. Security:

    • Never expose API keys
    • Validate email addresses
    • Rate limit email sending
    • Monitor for abuse
  3. 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.