All Docs
FeaturesNurtureHubUpdated March 20, 2026

Email Delivery Tracking & Webhook Integration

Email Delivery Tracking & Webhook Integration

NurtureHub receives real-time email delivery and engagement events from Resend via webhooks. These events update contact records, journey statuses, and intent scores automatically — no manual action is required from agents.

How It Works

When NurtureHub sends an email through Resend, it embeds a set of tracking tags in the message. When Resend delivers, bounces, or records engagement on that email, it posts a webhook event back to NurtureHub at:

POST /api/webhooks/resend

NurtureHub verifies the request's authenticity, identifies the internal records from the embedded tags, and routes the event into the appropriate processing pipeline via Inngest.

Tracked Events

Delivered

When Resend confirms successful delivery to the recipient's mail server:

  • The scheduledEmail record is marked sent with a deliveredAt timestamp
  • The corresponding journeyEmail step is marked sent
  • A delivered engagement event is recorded (neutral weight — no scoring impact)

Bounced

When a message cannot be delivered:

  • The contact's email address is suppressed
  • The active nurture journey is paused
  • The agent receives a notification

Spam Complaint

When a recipient marks the email as spam:

  • The contact's email address is suppressed
  • The contact's consent status is set to denied
  • The agent receives a notification

Opened

When a recipient opens an email:

  • An opened engagement event is recorded
  • Intent score recalculation is triggered for the contact

Link Clicked

When a recipient clicks a link in an email:

  • A clicked engagement event is recorded with the clicked URL
  • Intent score recalculation is triggered
  • Links matching booking or valuation patterns (e.g. /book, /valuat, /appoint, /calendly) receive a +30 point intent score weight

Delivery Delayed

When Resend reports a delivery delay, the event is logged. No action is taken — Resend retries automatically.

NurtureHub Email Tags

NurtureHub automatically embeds the following tags in every outgoing email sent via Resend. These tags are used to correlate webhook events back to internal records:

TagPurpose
nh_tenant_idIdentifies the agency account
nh_contact_idIdentifies the contact
nh_scheduled_email_idIdentifies the specific scheduled email
nh_journey_idIdentifies the nurture journey
nh_journey_email_idIdentifies the step within the journey

If a webhook event arrives without NurtureHub tags (e.g. emails sent outside the platform), it is logged and ignored.

Engagement & Opens via Webhook vs. Pixel Tracking

NurtureHub supports two parallel paths for tracking opens and clicks:

  • Pixel / redirect tracking — embedded tracking pixel and tracked links in the email body
  • Resend webhook — server-side event delivery from Resend, independent of image loading or link-click behaviour

Both paths feed into the same email-engagement-processor Inngest function. The webhook path uses a synthetic token ID (format: resend_open_<messageId>) to identify the source.

Configuration

To enable webhook delivery, configure RESEND_WEBHOOK_SECRET with the signing secret from your Resend webhook settings:

  1. Go to https://resend.com/webhooks
  2. Create a new webhook pointing to https://<your-domain>/api/webhooks/resend
  3. Select all event types
  4. Copy the signing secret and set it as RESEND_WEBHOOK_SECRET in your environment

If RESEND_WEBHOOK_SECRET is not set, signature verification is skipped. This is intended for local development only — always configure the secret in staging and production environments.

Signature Verification

NurtureHub verifies every incoming webhook request using SVIX HMAC-SHA256 signature verification:

  • The signed content is: {svix-id}.{svix-timestamp}.{raw-body}
  • The svix-signature header may contain multiple space-separated v1,<base64> signatures — the request is accepted if any one of them matches
  • Requests with a timestamp older than 5 minutes are rejected to prevent replay attacks
  • Verification uses the Web Crypto SubtleCrypto API, compatible with Next.js Node.js and Edge runtimes

Relevant HTTP Headers

HeaderDescription
svix-idUnique message ID for this webhook delivery
svix-timestampUnix timestamp (seconds) of when the message was sent
svix-signatureSpace-separated list of v1,<base64-hmac> signatures

Idempotency

The delivery confirmation processor is idempotent. If a delivered event is received for an email already in sent or cancelled status, processing is skipped without error. This prevents duplicate status updates if Resend delivers the webhook more than once.