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
- Sign in to dash.keplars.com
- Navigate to Webhooks section
- Click Add New Webhook
Configure Webhook
- Enter your webhook endpoint URL
- Select events to receive (delivered, bounced, failed, opened)
- Add optional webhook secret for security
- Click Create Webhook
Test Webhook
- Click Test Endpoint to send sample event
- Verify your endpoint receives the event
- Check that webhook appears as active
Webhook Events
Common webhook events you'll receive:
email.delivered- Email successfully deliveredemail.bounced- Email bounced (hard/soft)email.failed- Email delivery failedemail.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.