All use cases
{ }

Webhook Development & Testing

Build and debug email-triggered webhooks

MailBrew's webhook notifications let you receive email events in your application. Build and test email-driven workflows like auto-creating support tickets, processing order confirmations, and alert notifications.

Why MailBrew for this use case

01

Real-time notifications

Webhooks fire instantly on email receipt. Zero latency and resource consumption from polling.

02

Flexible payload

Receive all email data as JSON: subject, body, headers, attachment info, and more.

03

Retry and logging

Monitor webhook delivery success/failure in the dashboard. Manual retry available for failures.

04

Local development

Combine with ngrok or Cloudflare Tunnel to receive and debug webhooks in your local environment.

Sample code

JavaScript (Express)

JavaScript (Express)
// Express.js: Receive MailBrew webhooks
const express = require('express');
const app = express();
app.use(express.json());

app.post('/webhook/mailbrew', (req, res) => {
  const { address, email } = req.body;
  console.log(`New email at ${address}`);
  console.log(`Subject: ${email.subject}`);

  if (email.subject.includes('Order Confirmation')) {
    processOrder(email);
  } else if (email.subject.includes('Support')) {
    createTicket(email);
  }

  res.status(200).json({ received: true });
});

app.listen(3000);

Ready to try this use case?

Get started with the free plan today. No credit card required.

Create free account