gitlabEdit

๐Ÿ“งEmail Events

Webhook events for Email service.

Overview

Currently, the Email service does not support webhooks in Docs-Dispatcher v1.0.

Email dispatch uses SMTP directly, which provides immediate send/fail responses but does not offer webhook-based event tracking for delivery status, opens, or clicks.

Why No Webhooks?

Email dispatch via SMTP is synchronous and completes immediately:

  1. Immediate Send: Email is handed to SMTP server in <1 second

  2. Quick Response: Success/failure returned immediately

  3. No Delivery Tracking: SMTP doesn't provide delivery/open/click events

Typical workflow:

// Email dispatch is synchronous
const response = await fetch('/api/email', {
  method: 'POST',
  body: JSON.stringify({
    from: '[email protected]',
    to: ['[email protected]'],
    subject: 'Hello',
    template: { id: 123, data: {} }
  })
});

const { success, messageId } = await response.json();
console.log('Email sent:', messageId); // Immediate result

What About Delivery/Opens/Clicks?

SMTP Limitations:

  • โœ… Immediate send confirmation

  • โŒ No delivery notifications (recipient received email)

  • โŒ No open tracking (recipient opened email)

  • โŒ No click tracking (recipient clicked links)

For advanced tracking, use dedicated email service providers instead of SMTP.

Alternative: Email Service Providers

For delivery tracking, opens, and click analytics, integrate directly with email platforms:

SendGrid Webhooks

Brevo (formerly Sendinblue) Webhooks

Configure webhook: Brevo Dashboard โ†’ Settings โ†’ Webhooks

Mailgun Webhooks

Planned Future Support

Email webhook support is planned for v2.0:

Planned Events:

  • email.sent - Email successfully handed to SMTP server

  • email.delivered - Email delivered to recipient's inbox

  • email.bounced - Email bounced (invalid address, full inbox)

  • email.opened - Recipient opened the email

  • email.clicked - Recipient clicked a link

  • email.spam - Marked as spam by recipient

  • email.unsubscribed - Recipient unsubscribed

circle-info

Coming in v2.0 (Q4 2026): Webhook support for email events via integrated ESPs. Subscribe to the changelog for updates.

Current Workarounds

1. Use Sync Mode (Default)

Email dispatch returns immediately:

2. SMTP Bounce Handling

Monitor bounce emails:

3. Direct ESP Integration

Use email service providers directly for advanced features:

Provider
Delivery Tracking
Opens
Clicks
Webhooks
Docs

SendGrid

โœ… Yes

โœ… Yes

โœ… Yes

โœ… Yes

Brevo

โœ… Yes

โœ… Yes

โœ… Yes

โœ… Yes

Mailgun

โœ… Yes

โœ… Yes

โœ… Yes

โœ… Yes

Amazon SES

โœ… Yes

โœ… Yes

โœ… Yes

โœ… Yes

Postmark

โœ… Yes

โœ… Yes

โœ… Yes

โœ… Yes

4. Email Analytics Platforms

Use analytics platforms for tracking:

Google Analytics: Add UTM parameters to links in emails:

Track in Google Analytics to see email-driven traffic.

Async Mode (Without Webhooks)

You can use async mode, but no webhook is sent:

Note: Email will be sent, but no delivery/open/click notifications.

Comparison with Webhook Services

Feature
Email
eSign
Postal

Webhook Support

โŒ No

โœ… Yes

โœ… Yes

Delivery Tracking

โŒ No

โœ… Yes

โœ… Yes

Response Time

<1 sec

30-300 sec

60-600 sec

Best Mode

Sync

Async + Webhook

Async + Webhook

Best Practices

Track Engagement Without Webhooks

1. Tracking Pixels:

2. Link Redirects:

3. UTM Parameters:

Handle Bounces

Configure bounce handling:

Next Steps

Getting Notified of Updates

Subscribe for webhook support updates:

  • Changelog: Version history

  • GitHub: Watch releases (TBD)

  • Newsletter: Email updates (TBD)

Last updated