Sending an email is only the beginning of the story. Your application also needs to learn what happened afterwards: delivered, deferred, bounced, reported as spam, opened or clicked. Those events decide whether you suppress an address, retry a send, notify a customer or update a dashboard. There are three common ways to receive them: the provider pushes events to your endpoint (webhooks), your application asks for them at intervals (polling an events API) or you download batches of logs. Each has strengths and costs, and the best production designs often combine two of them. This guide compares the options on latency, reliability, security, load and effort, explains ordering and duplicates, and ends with a decision guide and a hybrid pattern that gives you speed with a safety net. For a deeper look at handlers see webhook handler reliability and signature verification.
The three approaches
| Approach | How it works | Latency | Effort | Main risk |
|---|---|---|---|---|
| Webhook | Provider sends an HTTPS POST to your URL for each event or batch of events | Seconds | Public endpoint, signature check, idempotent handler, retries | Missed events during downtime; bursts overwhelm your server |
| Polling an events API | Your job calls the provider every N seconds with a cursor or time window | Interval-dependent: seconds to minutes | Scheduler, cursor storage, rate limit handling | Gaps if cursors are wrong; wasted calls when quiet |
| Log export / data warehouse feed | Files delivered or fetched on a schedule | Minutes to hours | Storage and parsing | Too slow for operational reactions |
| Provider UI only | Humans look at a dashboard | Manual | None | Does not scale; no automation |
Latency and what it means
Some reactions are urgent and others are not. A bounce on a password reset should flag the problem to the user quickly. Suppressing a hard-bounced address before the next campaign matters within minutes or hours. Engagement metrics can be updated daily. Ask what the business needs rather than defaulting to the fastest option. Webhooks give near real-time. Polling every minute gives a worst-case delay of a minute plus processing. Hourly exports suit reports. See message lifecycle and events for the event types.
Reliability compared
- Webhooks are at-least-once, usually. Providers retry failed deliveries with backoff for a limited time, so you may receive duplicates and out-of-order events, and you may lose events if your endpoint is down longer than the retry window.
- Polling is as reliable as your cursor. If you store the last position carefully, you can resume after downtime and retrieve everything still within the provider's retention period.
- Exports are complete but delayed, and are best for reconciliation.
- All methods need idempotency. Use the provider's event ID as a unique key and ignore repeats. See idempotency patterns.
Security
| Concern | Webhook | Polling |
|---|---|---|
| Exposure | Public endpoint that attackers can probe | Outbound calls only; no inbound port |
| Authentication | Verify the signature and timestamp on every request | Protect the API key; rotate it. See API key security |
| Replay | Reject old timestamps and repeated IDs | Not applicable |
| Network rules | Allow provider IP ranges if published, but rely on signatures | No inbound firewall change |
| Data handling | Payloads contain recipient addresses; use HTTPS and avoid logging bodies | Same data, retrieved on demand |
Polling suits environments that cannot expose an endpoint, such as internal systems behind strict firewalls. Webhooks suit cloud applications. Whatever you choose, treat event payloads as untrusted input: validate fields, bound sizes and never execute content from them.
Load and rate limits
A large campaign can generate hundreds of thousands of events in a short window. With webhooks, your endpoint must accept them quickly: respond with a success code immediately after validating, put the payload on a queue and process asynchronously. Without a queue, slow database writes cause timeouts, retries and still more load. With polling, you control the pace, but frequent calls hit rate limits; use cursors, page sizes and backoff, and poll more often only when there is traffic. Exports have no real-time load at all, which is why they are good for heavy analytics.
# Webhook endpoint outline
POST /hooks/email
1. verify signature + timestamp -> 401 if invalid
2. parse events -> 400 if malformed
3. enqueue each event (id, type, time, recipient, payload)
4. return 200 within a second
worker:
for event in queue:
if seen(event.id): continue # idempotency
apply(event) # suppress, update status, notify
mark_seen(event.id)Ordering
Events about one message can arrive out of order: a "delivered" event may precede a "processed" event, or a click may arrive before the open. Do not rely on arrival order. Store the event timestamp and compare it with the current state, applying only transitions that make sense. For critical states, such as suppression, the rule is simple: a hard bounce or complaint always wins, whatever order events arrive in. See suppression lists.
A hybrid design
The most dependable pattern combines webhooks with reconciliation:
- Receive webhooks for speed and handle them through a queue with idempotent processing.
- Record the latest event time you have processed per stream.
- Run a scheduled reconciliation job (every few minutes or hourly) that polls the events API from that point minus a small overlap window, and processes any events you have not seen.
- Alert when the reconciliation finds more than a few missing events, which indicates endpoint downtime or delivery problems.
- Once a day, compare counts of sent, delivered and bounced messages with the provider's totals or export.
- Keep raw events for a period for debugging, within your retention policy. See data retention.
Costs and operational effort
Webhooks require an endpoint that is highly available, monitored and secured, which means hosting, certificates and on-call attention. Polling needs a scheduler and a reliable place to store the cursor, but its failure mode is gentle: if a poll is missed, the next one catches up. Exports need storage and a parser, with the cost growing in step with volume. Consider the team as well as the system: a small team may prefer one simple mechanism that it can run reliably over a sophisticated one that nobody understands at three in the morning. Start with the simplest design that meets your latency goal, add reconciliation when events matter financially or legally, and revisit the design when volume grows tenfold.
Decision guide
| Situation | Choose |
|---|---|
| Cloud app, needs fast bounce handling | Webhooks, plus reconciliation poll |
| Behind a firewall, cannot accept inbound traffic | Polling with cursors |
| Analytics and reporting only | Scheduled export or warehouse feed |
| Low volume, simple needs | Webhooks with a basic idempotent handler |
| Very high volume | Webhooks into a queue or stream, then workers; export for audits |
| Compliance needing a complete record | Webhooks or polling plus export retained for audits |
Monitoring
Whatever method you use, measure it: the delay between event time and processing time, the number of events per minute, the failure rate of your endpoint, the queue depth and the number of events recovered by reconciliation. Alert when delay exceeds your service goal. See delivery monitoring.
The choice is rarely webhooks or polling alone. Push gives you speed, pull gives you certainty, and a small reconciliation job turns two imperfect mechanisms into a dependable one.
Get events your way Webhooks, an events API and logs for every message.
References and further reading
Frequently asked questions
Should I use webhooks or polling for bounces?
Webhooks give the fastest reaction. Add a periodic poll or export to catch events missed during downtime.
Can webhook events arrive twice or out of order?
Yes. Use the event ID for idempotency and compare timestamps before changing state.
How do I protect a webhook endpoint?
Verify the signature and timestamp, use HTTPS, reject replays and keep payloads out of logs.
What if my endpoint is down for an hour?
Providers retry for a limited time. A reconciliation poll from your last processed time recovers the rest.
When is a log export better?
For analytics, audits and reconciliation where delay of minutes or hours is acceptable.