Why Connect Supabase to Inbound Email
Supabase stores structured data, but a surprising amount of business data still arrives via email — form submissions, order confirmations, sensor reports, and CSV attachments. JsonHook acts as the extraction layer, parsing incoming emails and pushing the relevant fields into Supabase as new rows or updated records without any manual intervention.
Connecting your inbound email to Supabase through JsonHook unlocks a range of high-value automation scenarios:
- Insert a new row for every inbound form-submission email
- Update existing records when a status-change email is received
- Store complete email metadata alongside extracted field values
- Aggregate daily report emails into a time-series table automatically
- Sync external order data from email confirmations into your database schema
Supabase supports Supabase Edge Function (HTTP POST handler) or REST API insert, which makes it a natural target for JsonHook's outbound POST requests. Every email that hits your JsonHook address is parsed within milliseconds and delivered to Supabase as a clean JSON object — no polling, no manual export, no middleware server to maintain.
Setting Up Supabase with JsonHook
The following steps walk you through connecting JsonHook to Supabase. The entire setup typically takes under ten minutes.
- Step 1: In your Supabase project, create a table called
inbound_emailswith columns:id(uuid, default gen_random_uuid()),message_id(text unique),from_address(text),subject(text),body(text),received_at(timestamptz),raw(jsonb). - Step 2: Deploy a Supabase Edge Function named
receive-emailthat accepts a POST request, parses the JsonHook payload, and inserts a row intoinbound_emailsusing the Supabase JS client. - Step 3: In JsonHook, create an inbound address and set the Edge Function URL (
https://your-project.supabase.co/functions/v1/receive-email) as the destination. Add anAuthorization: Bearer YOUR_ANON_KEYheader. - Step 4: Test by sending an email to the address and verifying the row appears in the Supabase Table Editor.
Once the connection is active, every email sent to your JsonHook address will be automatically parsed and forwarded to Supabase. You can test the integration by sending a plain-text email to your JsonHook address and verifying that the payload appears in Supabase within a few seconds.
JsonHook supports Supabase Edge Function (HTTP POST handler) or REST API insert on the Supabase side, so no additional configuration is needed in Supabase beyond the steps above. If Supabase requires header-based authentication for incoming webhooks, add the required headers in the JsonHook endpoint configuration under Advanced Settings.
Automate Supabase with Email Webhooks
Free tier: 100 emails/month. Set up in minutes.
Get Free API KeyExample Workflow: When a contact form email arrives, insert the parsed data into a Supabase Postgres table and trigger a real-time notification
This walkthrough demonstrates one concrete way to use JsonHook with Supabase. The scenario: When a contact form email arrives, insert the parsed data into a Supabase Postgres table and trigger a real-time notification.
When an email matching this scenario arrives, JsonHook parses the raw SMTP message and constructs the following JSON payload before POSTing it to your Supabase endpoint:
{
"messageId": "",
"from": {
"name": "Jane Smith",
"address": "[email protected]"
},
"to": [
{ "address": "[email protected]" }
],
"subject": "When a contact form email arrives, insert the parsed data into a Supabase Postgres table and trigger a real-time notification",
"text": "Hi, I need help with my account. Please contact me at your earliest convenience.",
"html": "Hi, I need help with my account...
",
"date": "2026-03-15T10:32:00.000Z",
"attachments": [],
"headers": {
"x-priority": "1"
}
}
Supabase insert: messageId → message_id, from.address → from_address, subject → subject, text → body, date → received_at, full JsonHook payload object → raw (jsonb). The raw column preserves all fields for future querying.
Once Supabase receives this payload, it can execute any downstream action — whether that is posting a notification, creating a record, updating a field, or triggering an entire multi-step workflow. The key advantage is that the data arrives as structured JSON, so Supabase never needs to parse raw email text or deal with MIME encoding.
Payload Mapping for Supabase
JsonHook delivers a consistent JSON schema for every parsed email. The table below shows which JsonHook fields map to the equivalent fields in Supabase. Use this as a reference when configuring your Supabase Supabase Edge Function (HTTP POST handler) or REST API insert.
| JsonHook Field | Description | Supabase Field |
|---|---|---|
from.address | Sender email address | Sender / Contact email |
from.name | Sender display name | Sender / Contact name |
subject | Email subject line | Title / Subject / Name |
text | Plain-text email body | Description / Body / Message |
html | HTML email body | Rich text field / Notes |
date | Timestamp of receipt (ISO 8601) | Created date / Received at |
attachments[n].filename | Attachment filename | File name / Attachment label |
attachments[n].content | Attachment content (base64) | File content / Binary field |
headers.* | Raw email headers | Metadata / Custom properties |
messageId | Unique message identifier | External ID / Deduplication key |
Not every field will be present in every email. Always check for null or missing values before mapping to required fields in Supabase. For text-only emails, html will be empty; for HTML-only emails, text may be empty or auto-generated from the HTML. The attachments array will be an empty array when no files are attached.
Best Practices for Supabase Email Integration
Following these best practices will make your Supabase email integration more reliable, easier to debug, and simpler to scale as your email volume grows.
- Use dedicated addresses per workflow. Create a separate JsonHook inbound address for each distinct Supabase workflow you want to trigger. This makes routing explicit and avoids a single endpoint becoming a bottleneck for all email types.
- Validate the payload before acting. In Supabase, add a conditional check at the start of your workflow to confirm that required fields like
from.addressandsubjectare present and non-empty before executing downstream actions. - Test with real emails first. Use JsonHook's delivery log to inspect the raw JSON payload before wiring up Supabase. Confirm that all the fields you plan to map are actually populated by your email source.
- Handle errors gracefully. Configure Supabase to catch webhook delivery failures and send an alert. JsonHook will retry failed deliveries, but your Supabase endpoint should return a 2xx status promptly to acknowledge receipt.
- Keep secrets out of email content. Avoid routing emails that contain passwords, API keys, or PII through workflows unless you have appropriate data-handling controls configured in Supabase. Use JsonHook's HTTPS delivery to protect data in transit.