Keplers Mail Service

Webhooks

Receive real-time notifications about email delivery events

Get real-time notifications when emails are delivered, bounced, or opened through webhook endpoints.

Real-time Events: Webhooks notify your application instantly when email events occur, enabling responsive user experiences.

Setup Webhooks

Access Webhook Settings

  1. Sign in to dash.keplars.com
  2. Navigate to Webhooks section
  3. Click Add New Webhook

Configure Webhook

  1. Enter your webhook endpoint URL
  2. Select events to receive (delivered, bounced, failed, opened)
  3. Add optional webhook secret for security
  4. Click Create Webhook

Test Webhook

  1. Click Test Endpoint to send sample event
  2. Verify your endpoint receives the event
  3. Check that webhook appears as active

Webhook Events

Common webhook events you'll receive:

  • email.delivered - Email successfully delivered
  • email.bounced - Email bounced (hard/soft)
  • email.failed - Email delivery failed
  • email.opened - Email opened by recipient

Event Payload

All webhook events follow this structure:

{
  "id": "evt_123",
  "type": "email.delivered",
  "timestamp": "2024-01-15T10:35:00Z",
  "data": {
    "email_id": "email_456",
    "to": "[email protected]",
    "subject": "Welcome!",
    "status": "delivered"
  }
}

Handle Webhooks

Basic Handler

app.post('/webhooks/keplers', (req, res) => {
  const event = req.body;
  
  switch (event.type) {
    case 'email.delivered':
      console.log(`Email delivered to ${event.data.to}`);
      break;
    case 'email.bounced':
      console.log(`Email bounced: ${event.data.bounce_reason}`);
      break;
  }
  
  res.status(200).json({ received: true });
});

Security

Verify webhook signatures for security:

const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature, 'hex'),
    Buffer.from(expectedSignature, 'hex')
  );
}

Next Steps

  • AI Templates - Create smart email templates
  • Examples - See integration examples for your programming language

Webhooks keep your application updated with real-time email delivery status.

On this page