Custom Webhook Email to Webhook Integration

Route inbound emails directly into Custom Webhook as structured JSON. A custom webhook handler is any HTTP endpoint you build yourself — in Node.js, Python, Go, or any language — to receive and process structured JSON payloads. JsonHook bridges the gap between your inbox and Custom Webhook — no custom server required.

Table of Contents
  1. Why Connect Custom Webhook to Inbound Email
  2. Setting Up Custom Webhook with JsonHook
  3. Example Workflow: When a monitoring alert email arrives, parse the error message and insert an incident record into a PostgreSQL database
  4. Payload Mapping for Custom Webhook
  5. Best Practices for Custom Webhook Email Integration

Why Connect Custom Webhook to Inbound Email

Custom Webhook powers production systems that need to react to external events. Email is still a common delivery mechanism for alerts, notifications, and inter-service messages — especially from legacy systems or third-party services that don't offer webhooks. JsonHook gives your Custom Webhook integration a reliable inbound email endpoint that delivers clean, structured JSON.

Connecting your inbound email to Custom Webhook through JsonHook unlocks a range of high-value automation scenarios:

  • Receive webhook-style callbacks from services that only support email notifications
  • Forward CI/CD alert emails into your incident management pipeline
  • Parse structured data out of report emails and insert it into your database
  • Trigger serverless functions whenever a specific email pattern is matched
  • Bridge legacy systems that communicate via email to modern webhook-driven APIs

Custom Webhook supports Any HTTP POST endpoint (your own server or serverless function), 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 Custom Webhook as a clean JSON object — no polling, no manual export, no middleware server to maintain.

Setting Up Custom Webhook with JsonHook

The following steps walk you through connecting JsonHook to Custom Webhook. The entire setup typically takes under ten minutes.

  1. Step 1: Write an HTTP endpoint in your language of choice that listens for POST requests and reads the JSON body. Validate an optional shared secret from the request headers for security.
  2. Step 2: Parse the JsonHook payload fields — from, subject, text, attachments — and implement your business logic: insert into a database, call another API, send a notification, or trigger a background job.
  3. Step 3: Deploy the endpoint to a publicly accessible URL — a VPS, AWS Lambda, Google Cloud Run, or a Fly.io container all work well.
  4. Step 4: In JsonHook, create an inbound address and enter your endpoint URL as the destination. Optionally configure a custom X-Webhook-Secret header. Send a test email to verify end-to-end delivery.

Once the connection is active, every email sent to your JsonHook address will be automatically parsed and forwarded to Custom Webhook. You can test the integration by sending a plain-text email to your JsonHook address and verifying that the payload appears in Custom Webhook within a few seconds.

JsonHook supports Any HTTP POST endpoint (your own server or serverless function) on the Custom Webhook side, so no additional configuration is needed in Custom Webhook beyond the steps above. If Custom Webhook requires header-based authentication for incoming webhooks, add the required headers in the JsonHook endpoint configuration under Advanced Settings.

Automate Custom Webhook with Email Webhooks

Free tier: 100 emails/month. Set up in minutes.

Get Free API Key

Example Workflow: When a monitoring alert email arrives, parse the error message and insert an incident record into a PostgreSQL database

This walkthrough demonstrates one concrete way to use JsonHook with Custom Webhook. The scenario: When a monitoring alert email arrives, parse the error message and insert an incident record into a PostgreSQL database.

When an email matching this scenario arrives, JsonHook parses the raw SMTP message and constructs the following JSON payload before POSTing it to your Custom Webhook endpoint:

{
  "messageId": "",
  "from": {
    "name": "Jane Smith",
    "address": "[email protected]"
  },
  "to": [
    { "address": "[email protected]" }
  ],
  "subject": "When a monitoring alert email arrives, parse the error message and insert an incident record into a PostgreSQL database",
  "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" } }

Your endpoint has full control over field mapping. Reference the JsonHook payload schema: top-level fields include messageId, from (object), to (array), cc (array), subject, text, html, date, attachments (array), and headers (object). Use any JSON parsing library to extract exactly what you need and transform it into your target data structure.

Once Custom Webhook 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 Custom Webhook never needs to parse raw email text or deal with MIME encoding.

Payload Mapping for Custom Webhook

JsonHook delivers a consistent JSON schema for every parsed email. The table below shows which JsonHook fields map to the equivalent fields in Custom Webhook. Use this as a reference when configuring your Custom Webhook Any HTTP POST endpoint (your own server or serverless function).

JsonHook Field Description Custom Webhook Field
from.addressSender email addressSender / Contact email
from.nameSender display nameSender / Contact name
subjectEmail subject lineTitle / Subject / Name
textPlain-text email bodyDescription / Body / Message
htmlHTML email bodyRich text field / Notes
dateTimestamp of receipt (ISO 8601)Created date / Received at
attachments[n].filenameAttachment filenameFile name / Attachment label
attachments[n].contentAttachment content (base64)File content / Binary field
headers.*Raw email headersMetadata / Custom properties
messageIdUnique message identifierExternal 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 Custom Webhook. 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 Custom Webhook Email Integration

Following these best practices will make your Custom Webhook 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 Custom Webhook 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 Custom Webhook, add a conditional check at the start of your workflow to confirm that required fields like from.address and subject are 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 Custom Webhook. Confirm that all the fields you plan to map are actually populated by your email source.
  • Handle errors gracefully. Configure Custom Webhook to catch webhook delivery failures and send an alert. JsonHook will retry failed deliveries, but your Custom Webhook 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 Custom Webhook. Use JsonHook's HTTPS delivery to protect data in transit.

Frequently Asked Questions

Can I send emails to Custom Webhook via webhook?
Yes. JsonHook provides a unique inbound email address for each webhook endpoint you configure. When an email is delivered to that address, JsonHook parses the message — extracting the sender, subject, body text, HTML body, and any attachments — and immediately POSTs the result as a structured JSON payload to your Custom Webhook Any HTTP POST endpoint (your own server or serverless function). From there, Custom Webhook can trigger any downstream action you have configured.
Do I need to code to connect JsonHook to Custom Webhook?
Some familiarity with HTTP requests and JSON is helpful when integrating JsonHook with Custom Webhook. You'll need to configure the webhook endpoint in your application and parse the JSON payload that JsonHook delivers. No specialized framework is required — a simple HTTP handler in any language is sufficient.
How do I filter which emails go to Custom Webhook?
JsonHook uses address-based routing. Create a dedicated inbound address such as [email protected] and point it exclusively at your Custom Webhook webhook URL. You can also create multiple addresses for different email categories — one for support, one for sales leads, one for order notifications — each routed to a different Custom Webhook workflow or channel. If Custom Webhook supports conditional logic, you can add further filtering on the subject, from, or any custom field in the parsed JSON payload.
What HTTP status code should my endpoint return to JsonHook?
Return a 200 OK (or any 2xx status) as quickly as possible to acknowledge receipt. If your processing takes more than a few seconds, acknowledge immediately and handle the work asynchronously in a background queue. JsonHook considers any non-2xx response a delivery failure and will retry with exponential backoff.
How do I verify that a webhook request genuinely came from JsonHook?
Configure a shared secret in your JsonHook endpoint settings. JsonHook will include this value in an X-JsonHook-Secret header on every request. In your endpoint, compare the header value against your stored secret using a constant-time string comparison to prevent timing attacks.