Supabase project dashboard with Edge Functions navigation highlighted in sidebar
2
Deploy New Function
Click on Deploy a new function in the upper-right corner and select Via Editor.
Supabase Edge Functions page showing Deploy a new function button with dropdown menu
3
Add Function Code
Inside the function editor, you should see the default serverless function template.
Supabase Edge Function editor showing default function template code
Replace it with the following code snippet, which will:
Receive user data from the webhook
Call the Mailtrap API to update existing contact details
And, of course, click on Deploy updates/Deploy function.
Supabase Edge Function editor with Deploy function button highlighted
Step 2. Set up a webhook for updating contacts
1
Create Webhook
If you don't already have a webhook for updating contacts, open your Supabase Dashboard, go to Database Webhooks, and click on Create a new hook.
Navigate to Integrations → Webhooks and configure the following:
Name: update_contact
Table: profiles
Events: ✅ Update
Supabase webhook configuration form showing name set to update_contact, table set to profiles, and Update event checkbox
2
Configure Webhook Settings
Configure the following:
Type of webhook: HTTP Request
Method: POST
Edge Function: Select the previously created update-contact function
Add HTTP Headers:
Content-Type: application/json
Authorization: Bearer [your-token]
Supabase webhook configuration showing HTTP Request type, POST method, Edge Function selection, and HTTP headers
Integration demo and testing
Finally, let's test our webhook configuration. For this example, I'll use a demo app created in FlutterFlow.
1
Create Test Account
First, create an account as if you were a new user.
2
Verify in Supabase
A new user should appear in the Users page within your Supabase Project.
Supabase Authentication Users page showing newly created user in table
3
Verify in Mailtrap
At the same time, a new user also appears in your Mailtrap Contacts page.
Mailtrap Contacts page showing newly synced contact with email address
4
Check Initial Data
Since the demo app only requires email and password upon registration, that's all the info the webhook sends to the Mailtrap Contacts page initially.
Mailtrap contact detail showing only email field populated
5
Update Profile
If you go to your demo app and update the profile name...
6
Verify Update in Supabase
It should get updated in your Supabase Project...
Supabase profiles table showing updated full_name field
7
Verify Update in Mailtrap
And the Mailtrap Contacts Page, so everything works as intended!
Mailtrap Contacts page showing updated contact with name field now populated
Now, every time a new user logs in and updates their name, their information will be logged in your Mailtrap Contacts page. There, you can group them into lists, segment them accordingly, and use Fields to personalize your email campaigns further.