Skip to content

Commit cd738cd

Browse files
authored
Merge pull request #71 from marmelab/document-email-setup
Document email setup
2 parents fb4357b + 5bc8cd0 commit cd738cd

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

doc/developer/supabase-configuration.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ make supabase-remote-init
1212

1313
The script will ask you for the Supabase instance name, create the database, apply the migrations and deploy the edge functions. Finally, it will create a `.env.production.local` file with your remote Supabase configuration.
1414

15+
### Setting Up An Email Provider
16+
17+
The script cannot yet automate the configuration of the required SMTP provider on your Supabase instance. To do that, please follow the instructions detailed in the [Email Provider Setup](#email-provider-setup) section.
18+
1519
## Alternative: Using An Existing Supabase Instance
1620

1721
If you already created a project on [supabase.com](https://supabase.com/), you can configure the Atomic CRM frontend to use it.
@@ -42,6 +46,10 @@ VITE_SUPABASE_URL=<instance_url>
4246
VITE_SUPABASE_ANON_KEY=<instance_anon_token>
4347
```
4448

49+
### Setting Up An Email Provider
50+
51+
Atomic CRM requires that you set up an email provider on your Supabase instance. If you don't have one yet, please follow the instructions detailed in the [Email Provider Setup](#email-provider-setup) section.
52+
4553
## Testing Production Mode
4654

4755
Before deploying the frontend code to production, you may want to test the local frontend code when connected to the remote Supabase instance.
@@ -54,6 +62,32 @@ make prod-start
5462

5563
Using a remote Supabase instance can be interesting if you deploy from your computer, or if you want to test your app with production data in production mode.
5664

65+
## Email Provider Setup
66+
67+
In order to support [the invitations workflow](../user/user-management.md#adding-users) and the default email/password authentication (including password reset), Atomic CRM needs to be able to send emails from your Supabase instance.
68+
69+
By default, Supabase provides a simple SMTP server for all projects. But this server imposes a few important restrictions and is not meant for production use:
70+
- It can only send messages to pre-authorized addresses
71+
- It imposes significant rate-limits
72+
- There is no SLA guarantee on message delivery or uptime
73+
74+
For this reason, it is recommended to use a [custom SMTP provider](https://supabase.com/docs/guides/auth/auth-smtp#how-to-set-up-a-custom-smtp-server).
75+
76+
A non-exhaustive list of services that work with Supabase Auth is:
77+
78+
- [Postmark](https://postmarkapp.com/developer/user-guide/send-email-with-smtp) (recommended if you also plan to use the [Inbound Email](../user/inbound-email.md) feature)
79+
- [Resend](https://resend.com/docs/send-with-supabase-smtp)
80+
- [AWS SES](https://docs.aws.amazon.com/ses/latest/dg/send-email-smtp.html)
81+
- [Twilio SendGrid](https://www.twilio.com/docs/sendgrid/for-developers/sending-email/getting-started-smtp)
82+
- [ZeptoMail](https://www.zoho.com/zeptomail/help/smtp-home.html)
83+
- [Brevo](https://help.brevo.com/hc/en-us/articles/7924908994450-Send-transactional-emails-using-Brevo-SMTP)
84+
85+
Once you've set up your account with an email sending service, head to the [Authentication settings page](https://supabase.com/dashboard/project/_/settings/auth) to enable and configure custom SMTP.
86+
87+
Once you save these settings, your project's Auth server will send messages to all addresses. To protect the reputation of your newly set up service a low rate-limit of 30 messages per hour is imposed. To adjust this to an acceptable value for your use case head to the [Rate Limits configuration page](https://supabase.com/dashboard/project/_/auth/rate-limits).
88+
89+
**Note:** Alternatively, you can also [set up an authentication hook](https://supabase.com/docs/guides/auth/auth-hooks/send-email-hook) to send the emails yourself.
90+
5791
## Setting The Login Callback
5892

5993
Atomic CRM uses Supabase's authentication system. When a user logs in, Supabase redirects them to an authentication callback URL that is handled by the frontend.

0 commit comments

Comments
 (0)