auth-js icon indicating copy to clipboard operation
auth-js copied to clipboard

Add support for transactional email providers

Open kasvith opened this issue 1 year ago • 4 comments

Feature request

Is your feature request related to a problem? Please describe.

Currently, we can enable SMTP providers with gotrue. This is also available in Supabase Studio. But there are other transactional email services, which is preferred by lot of users like

  • Mailgun
  • AmazonSES
  • Sendgrid

It would be awesome if supabase version of gotrue could support these providers. So in the UI it will be simply selecting provider and pasting API Key and Secret

Describe the solution you'd like

  • Implement transactional providers with GoTrue
  • Add it to supabase studio

kasvith avatar Aug 02 '22 20:08 kasvith

I'm just looking through the issues and this one made me curious. Don't all of those already support using smtp? What would be the difference?

RWOverdijk avatar Aug 05 '22 06:08 RWOverdijk

@RWOverdijk Web APIs are faster than SMTP relays. So they have a higher throughput. Almost all providers I mentioned above recommend using Web API instead of SMTP

kasvith avatar Aug 09 '22 07:08 kasvith

That's fair, passing off the message does mean less waiting in your own code. I didn't know that was the reasoning behind this issue.

Thanks for taking the time to clarrify.

RWOverdijk avatar Aug 09 '22 07:08 RWOverdijk

This also helps to reduce stress on the go-true server as it can simply send a lot of emails in a short time

Also, it will be possible to leverage the templates from these providers, so you only send data and the template ID for the provider and it can do the rest of the work without stressing the go-true server

kasvith avatar Aug 09 '22 07:08 kasvith

Hey everyone, we don't plan on adding these transactional email providers for now but we do have a generateLink method which allows you to generate the confirmation / invite / recovery / email change / magic link for a user. You can then call the API of one of these services and send the link in the body of the email.

GenerateLink method reference:

kangmingtay avatar Sep 30 '22 05:09 kangmingtay