Supabase
Send emails via SMTP with IndiePitcher
About Supabase Auth
Supabase is an open-source backend-as-a-service platform that offers developers a seamless way to build and scale applications. It’s often described as an open-source alternative to Firebase, providing essential tools like a Postgres database, serverless APIs, real-time capabilities, and integrated authentication—all in one package.
One of Supabase’s standout features is Supabase Auth, a robust authentication system that simplifies user management. With support for email-based login, social sign-ins (like Google, Facebook, and GitHub), and third-party OAuth providers, Supabase Auth helps developers add secure and scalable user authentication to their apps quickly.
At the heart of email-based authentication workflows, such as account creation, password reset, or email verification, is the need to send transactional emails to users. This is where IndiePitcher can help.
Even though Supabase Auth does support sending emails on your behalf with zero configuration, the offering is meant for development only and enforces a strict limit of 4 emails per hour (as of November 2024). For a production setup, you’ll want to authenticate with a 3rd-party SMTP server to send your user management-related emails.
Integration with IndiePitcher
Prerequisites:
- Create a project on Supabase
- Create a project on IndiePitcher and generate an API key
To start sending emails through IndiePitcher, navigate to Settings / Authentication in your Supabase project, and scroll down until you reach a section called SMTP Settings.
Provide following credentials:
Auth Credentials
- Host:
smtp.indiepitcher.com
- Port:
587
- Username:
indiepitcher
- Password:
YOUR_API_KEY
Sender Identity
Supabase allows you to configure the sender name and email address for your emails. These fields are currently ignored by IndiePitcher to prevent the SMTP proxy from being highjacked by spammers. Instead, the name and email address you configured in your IndiePitcher project settings will be used as the sender. We recommend providing the following values to prevent unexpected behavior in case we do add support for custom name and from fields in the future:
- Sender Name:
indiepitcher-ignore-sender-replyto
- Sender Email: anything, will be ignored
This is enough to start sending emails through IndiePitcher.
Testing
The easiest way to test your setup is to send an invitation email to sign up for your product.
This will send an email to the recipient with a link to sign up for your product. The design will match the default Supabase template.
Email Styling with Markdown
IndiePitcher makes it easy to create a good looking email using the markdown syntax, with few html tags mixed in when needed. Navigate to Email Templates section, tap on Invite User, and replace the default content with the following markdown:
Try to send yourself an invite again, and you should receive and email that looks something like this:
You can configure your logo, color scheme, and the content of the footer under your IndiePitcher project settings.
Congratulations, you have successfully integrated IndiePitcher with Supabase Auth! 🎉