Back
Loops

Loops

Overview

Loops is an email platform for software companies letting you send your product, marketing, and transactional email from one simple interface.

This integration allows you to send Supabase Authentication emails over Loops' SMTP service.

There are two big benefits to using Loops for sending your Supabase emails:

  • More control over design: You can use Loops' design editor to create (and then easily edit) beautiful transactional emails instead of having to code them with HTML.
  • Better visibility of sent email: You get full visibility on which emails are being sent, when, and to whom in your Loops account (something not offered in Supabase).

1. Set up Loops SMTP in Supabase

Go to your Authentication settings in Supabase (Project Settings -> Authentication) to tell Supabase to send emails using Loops' SMTP service.

Scroll down and toggle the Enable Custom SMTP option on.

In the Sender details section, you will need to enter some values into the "Sender email" and "Sender name" fields. However, these values will always be overwritten by the values set in your Loops templates from the next step.

In the SMTP Provider Settings section enter the following data:

FieldValue
Hostsmtp.loops.so
Port number587
Usernameloops
PasswordAn API key copied from your API settings in Loops

Note that for the interval and rate limit settings, you will be bound by Loops' API rate limit of 10 requests per second.

One final step is to check that the "Confirm email" toggle is turned on in the Email section in Authentication -> Providers.

2. Create Transactional emails in Loops

Next, create new transactional emails for the emails listed in Supabase (Authentication -> Email Templates). You need to create both Confirm signup and Magic Link emails to be able to properly set up the integration.

  • Confirm signup (required)
  • Invite user
  • Magic Link (required)
  • Change Email Address
  • Reset Password

Note that if a Supabase user has not previously confirmed their email, they will be sent a Confirm signup email when you request a Magic Link email.

To create new transactional emails, go to the Transactional page in Loops and click New. Alternatively, you can select one of our many ready-made templates from the Templates page.

Supabase template in the editor

You can then use the Loops editor to create nicely-designed templates or make them as simple as you like.

You can even save styles so you can easily apply consistent branding to all of your emails.

Saved styles

For each Loops template you create, you need to add data variables, which allow data from Supabase to be inserted into each email.

For example, you could add a confirmationUrl data variable that you can map to the {{ .ConfirmationURL }} value from Supabase.

You can also build URLs by including values like {{ .SiteUrl }} or add in a confirmation code using {{ .Token }}.

Supabase values

Once you're done creating the email and adding data variables, click Next. On the next page, click the Show payload button to view the API payload for your template. You will need this for the next step.

Email payload

Make sure to also publish your email! It won't send unless it's published.

Read our detailed guide for sending transactional emails.

3. Configure email templates in Supabase

The final step is to make sure your emails in Supabase are configured to send the correct data to Loops.

Loops SMTP integrations work a bit differently than most. Instead of sending a text or HTML email body, you set them up to send API-like data.

In Supabase, go to Authentication -> Email Templates, then edit each template to contain the payload as shown in the previous step (you can click the clipboard icon in Loops to copy the full payload).

Once pasted into the Message body, you need to add the Supabase message variables into the payload.

Important: Make sure you set up at least the Confirm signup and Magic Link templates in Supabase, otherwise emails will not be sent.

Also, any variables added in the Confirm signup template need to also be available in Magic link email, because Supabase will send a Confirm signup email instead of a Magic Link email if a user hasn't confirmed their email address.

Here is an example Confirm signup email template. This payload was copied from the template's Publish page in Loops, then the {{ .Email }} and {{ .ConfirmationURL }} Supabase variables were added.


_10
{
_10
"transactionalId": "clvmzp39u035tl50pw7wrl0ri",
_10
"email": "{{ .Email }}",
_10
"dataVariables": {
_10
"confirmationUrl": "{{ .ConfirmationURL }}"
_10
}
_10
}

Here's how it looks in the Supabase editor:

Supabase editor

With the integration now all set up, your Supabase authentication emails will be sent via Loops, giving you more visibility on your email sends and the great addition of being able to build beautiful and easy-to-update emails in the Loops editor.

To view all sends of your transactional emails, click through to the email from the Transactional page in Loops, where you'll find the Metrics page containing a table showing all sends and some statistics.

Important notes

  • You need to add a template in Loops and set up the email in Supabase for at least the Confirm signup and Magic Link templates.
  • The subject in Supabase templates is always overwritten by the subject added to the corresponding template in Loops.
  • The sender name and sender email configured in your Supabase SMTP settings are always overwritten by the sender details added to your templates in Loops.
  • Any Supabase email not set up with the correct API-like payload will fail to send.

Details

DeveloperLoops
CategoryMessaging
Websiteloops.so
DocumentationLearn

Third-party integrations and docs are managed by Supabase partners.