Prompt
How do I track bounces and complaints for app notification emails?
Latest observation
Oct 4, 2026
OpenAI APIWeb search: off
To track bounces and complaints for app notification emails, you typically need to use your email provider’s delivery event webhooks, SNS notifications, or event reporting API. The exact setup depends on the service you’re using, but the general pattern is the same.
What to track
- Bounce: the email couldn’t be delivered.
- Hard bounce: permanent failure, e.g. invalid address.
- Soft bounce: temporary failure, e.g. mailbox full.
- Complaint: the recipient marked the email as spam.
Common ways to track them
1) Use provider event webhooks
Most transactional email providers support sending delivery events to your app:
- SendGrid: Event Webhook
- Mailgun: Webhooks
- Postmark: Webhooks
- Amazon SES: SNS notifications / event publishing
- SparkPost: Webhooks
These events usually include:
- message ID
- recipient
- event type (
bounce,complaint,blocked,deferred, etc.) - timestamp
- bounce reason / diagnostic info
2) Store a message ID when sending
When you send the notification email, save:
- your internal notification ID
- provider message ID
- recipient email
- template/type
- timestamp
Then when the webhook arrives, match the event back to the original notification.
3) Update user status based on events
Typical actions:
- Hard bounce → suppress future emails to that address
- Complaint → immediately suppress future emails, maybe mark account/email as risky
- Soft bounce → retry later or just log
- Multiple bounces → consider suppression
4) Add a suppression list
Maintain a table of addresses you should not email:
- bounced addresses
- complained addresses
- unsubscribed addresses
- invalid addresses
Example flow
- Your app sends an email via SES/SendGrid/etc.
- You save the provider’s message ID in your DB.
- Provider posts a bounce/complaint event to your webhook.
- Your webhook handler:
- verifies the event
- looks up the message ID
- records the event
- suppresses future sends if needed
If you use Amazon SES
You can track these via:
- SNS topics for bounce/complaint/ delivery notifications
- Configuration sets
- Event publishing
You’d usually:
- Create an SNS topic
- Subscribe your app endpoint or Lambda
- Configure SES to publish bounce/complaint events to that topic
- Parse the notification payload and update your database
Minimal database fields to keep
For each sent email:
iduser_idemailproviderprovider_message_idstatus(sent,delivered,bounced,complained)bounce_typebounce_reasoncomplaint_atcreated_at
Important notes
- Complaints are urgent: suppress the recipient immediately.
- Verify webhook authenticity to avoid spoofed events.
- Deduplicate events because providers may send the same event more than once.
- Separate notification emails from account emails if possible, so complaints don’t impact important system mail.
If you want, I can show you:
- a provider-specific setup for SES, SendGrid, or Mailgun, or
- a sample webhook handler in Node.js, Python, or Go.