Developer guide

Convert Email to Webhook

If your system already uses webhooks internally, ParseForce lets email enter that same event flow. Incoming messages become webhook posts with parsed JSON and delivery metadata.

Webhook-first integration model

This page is for teams that do not want to poll inboxes or bolt parsing logic onto mail clients. Email becomes another signed event producer in the system.

  • Your app exposes a normal webhook endpoint.
  • ParseForce handles retries and delivery logging.
  • Payloads can be consumed by queues, workers, or event routers.

Delivery and verification

Webhook integrations get tricky when retries, duplicates, and signature verification are missing. Those details matter more than the parsing demo.

  • Use the event identifier for downstream idempotency.
  • Verify the request signature against the raw body.
  • Inspect delivery failures before replaying payloads.

Where this pattern works best

Webhook delivery is a good fit when email is only one producer in a larger event-driven system.

  • Route shipment updates, lead notifications, or vendor events into the same ingestion path.
  • Keep email parsing outside your application code and consume a stable event shape instead.
  • Use replay support when downstream systems are temporarily unavailable.

Example JSON output

Example webhook payload shape for this workflow.

json

{
  "event": "email.parsed",
  "mailboxId": "mbx_ship_19",
  "parsedData": {
    "tracking_number": "BLF-90211",
    "carrier": "BlueLine Freight",
    "status": "Delivered",
    "delivery_time": "2026-02-26T09:42:00",
    "recipient": "Marco Alvarez"
  },
  "rawEmail": {
    "from": "updates@bluelinefreight.com",
    "subject": "Shipment update"
  }
}

Node.js webhook signature verification

Minimal Node.js example for consuming ParseForce output.

node.js

import crypto from "crypto";
import express from "express";

const app = express();

app.post(
  "/webhooks/parseforce",
  express.raw({ type: "application/json" }),
  (req, res) => {
    const signature = req.header("x-parseforce-signature");
    const expected = crypto
      .createHmac("sha256", process.env.PARSEFORCE_WEBHOOK_SECRET)
      .update(req.body)
      .digest("hex");

    if (!signature || !crypto.timingSafeEqual(
      Buffer.from(signature, "hex"),
      Buffer.from(expected, "hex"),
    )) {
      return res.status(401).end();
    }

    const payload = JSON.parse(req.body.toString("utf8"));
    console.log(payload.event, payload.parsedData.tracking_number);

    return res.status(204).end();
  },
);

app.listen(3000);

Related guides

Related ParseForce pages

Explore related ParseForce pages for webhook delivery, schema design, and implementation details for adjacent email automation workflows.

See the full product overview