Supabase is a powerful open-source database infrastructure designed to streamline the development of modern web and mobile applications.
It’s a popular alternative to Google’s Firebase, providing developers with a PostgreSQL database, APIs, built-in authentication support, integrated storage, and other features to help a team build apps fast and collaborate easily.
Transactional emails, such as password reset notifications or order confirmations provide critical information to users and are essential in many apps.
This guide will walk you through configuring Supabase email settings to optimize delivery, enhance branding, and ensure seamless communication within your applications.
Getting Started With Supabase
Supabase offers a variety of installation methods to meet different project needs. You can choose self-hosting for complete control over your deployment or opt for the convenience of Supabase’s cloud-hosted platform.
For the purpose of this tutorial, we’ll focus on the hosted version of Supabase, allowing you to quickly get started and streamline the configuration process.
Supabase Email Configuration Options
The Supabase platform includes a built-in email service that allows you to send up to 3 emails per hour.
However, it’s recommended to use a custom SMTP service to send emails from Supabase. This offers several advantages and greater control over your application’s email infrastructure:
- Enhanced Deliverability: Using the SMTP services of a transactional email provider like SendLayer helps to ensure your messages reach their intended recipients. With superior mail infrastructure and domain reputation protection, your critical emails will be delivered swiftly and stay out of the spam folder
- Control Over Rate Limits: Using custom SMTP credentials will enable you to exceed Supabase’s default limitations. This is essential for scaling applications with high volumes of transactional emails. Once you’ve activated SMTP email, you can control email rate limits in your email configuration settings.
- Branding: Customize the “from” address and email content to align with your brand’s identity, improving recognition and trust for users.
- Compliance and Anti-Spam Measures: SMTP mail providers may offer features such as list cleaning tools and suppression lists to help you maintain a healthy email list and avoid spam violations.
- Detailed Analytics: Insights into email deliverability, open rates, click-through rates, and other metrics can help you optimize your email strategy for maximum engagement.
Supabase is compatible with any email provider with SMTP credentials. However, it’s advisable to choose a service designed for transactional emails such as SendLayer.
SendLayer is an email solution designed for developers, providing an SMTP relay for easy setup and an API for developers wanting more integration flexibility.
A user-friendly dashboard provides detailed email analytics and easy access to credentials for integration, while built-in domain reputation protection, mandatory authentication protocols, and carefully monitored sending IPs ensure your deliverability stays high.
Configuring Supabase Custom SMTP
Before you can get started with configuring Supabase to use your custom SMTP server, you’ll need to gather the credentials you need to integrate with the mail service.
If you’re using SendLayer, you’ll find these details on the Settings page, under SMTP credentials.
In Supabase, you can enable custom SMTP by navigating to your Project Settings and Choosing Authorization from the submenu.
Scroll down to SMTP Settings and toggle Enable Custom SMTP to on.
Enter your sender email and name. These will display as the “from” information on the emails you send. Make sure the email address you enter matches the domain you’ve authorized with SendLayer.
You can then enter the credentials from your SendLayer dashboard in the SMTP Provider Settings section as follows:
- Host: smtp.sendlayer.net
- Port number: 587
- Username: copy and paste the username from your SendLayer dashboard
- Password: copy and paste the password from your SendLayer dashboard
You can also adjust the interval between emails being sent. You may need to change this setting to meet any rate limits set by your SMTP provider.
When you’ve finished entering your SMTP credentials, click the Save button. You should see a message that the settings have been saved correctly.
Email Rate Limits and Customization
Supabase comes with a built-in authorization and user management system called Auth. You can further adjust your email configuration inside Auth.
Setting Email Rate Limits
From the Supabase homepage, scroll down and click the Explore Auth button on the Authentication product.
Choose Rate Limits from the Authentication menu. Here you can adjust the rate limit for emails as well as SMS messages, token refreshes and verifications, and number of anonymous sign-ins per hour.
Email Templates
You can also access Email Templates in the configuration menu. Here you can adjust the text of signup confirmations, invitations, confirmation of email change, and reset password emails.
After adjusting the template, you can view the resulting email as HTML or as a full preview.
Testing Email Configuration
You can also test your email configuration within the Auth app to make sure everything is set up correctly.
Navigate to Users in the menu and click the Add user button.
Click Send invitation, fill out an email address to send your test email to, and click the Invite user button.
This will generate and send an email invitation to the email address you specified.
Now email is set up and working on your Supabase project, you can continue developing apps with the knowledge that crucial transactional emails will reach the intended recipient.
And that’s it! Now you know how to set up Supabase custom SMTP.
Next, would you like to learn about using SMTP vs API for your development projects? Check out our tutorial on SMTP vs API for more information.
0 comment on "Supabase Custom SMTP and Email Configuration Guide"