Skip to main content

Emails

Your application uses Supabase's built-in email functionality for authentication and user management. This system handles various types of transactional emails essential for user authentication and account management.

Email Types

The following types of emails are automatically handled by Supabase:

  1. Signup Confirmation Emails: Sent when a new user registers using email/password authentication
  2. Magic Link Emails: Sent when a user requests passwordless authentication
  3. Password Reset Emails: Sent when a user requests to reset their password
  4. Email Change Confirmation: Sent when a user requests to change their email address

Configuration

Local Development

For local development, Supabase provides an email testing server called Inbucket. Emails sent during local development are not actually delivered but can be viewed through the Inbucket web interface at http://localhost:54324. The Inbucket server is automatically started when you run the Supabase development server.

Production Setup

For production, you'll need to configure an SMTP server to actually send emails to your users. This can be done through the Supabase dashboard:

  1. Log in to your Supabase dashboard
  2. Create a new project or select an existing project
  3. Go to Authentication > Emails > SMTP Settings
  4. Enter your SMTP server details

You may refer to the official Supabase documentation for detailed instructions on how to configure your SMTP settings.

Best Practices

  1. Testing: Always test email flows in development using Inbucket before deploying
  2. SMTP Setup: Configure a reliable SMTP provider before going to production
  3. Template Customization: Customize email templates to match your brand while keeping the core functionality intact
  4. Rate Limiting: Configure appropriate rate limits to prevent abuse
  5. Redirect URLs: Always specify correct redirect URLs in your authentication calls

For detailed information about email templates and their implementation, please refer to the Email Templates documentation.