Prompt
How do I get webhook notifications when an email fails?
Latest observation
Sep 23, 2026
OpenAI APIWeb search: off
To get webhook notifications when an email fails, you generally need to use your email provider’s delivery event webhooks or bounce/failure webhooks.
What to look for
Ask your provider for events like:
- bounce / hard bounce
- delivery failed
- blocked
- deferred / soft bounce
- complaint (sometimes relevant if delivery issues are caused by reputation)
Typical setup
- Create a webhook endpoint on your server (for example:
https://yourdomain.com/webhooks/email-events). - Configure your email service to send event callbacks to that URL.
- Subscribe to failure-related events in the provider dashboard or API.
- Verify the webhook signature so you trust incoming notifications.
- Handle retries and deduplication, since providers may send the same event more than once.
Example event handling logic
When a webhook arrives:
- If event =
bounceand reason = permanent/hard bounce → mark email address as undeliverable. - If event =
deferred→ log it and possibly retry later. - If event =
blocked→ inspect reputation, content, or recipient policy.
If you tell me your provider
If you’re using something like:
- SendGrid
- Mailgun
- Postmark
- Amazon SES
- Resend
- Mailjet
I can give you the exact steps and sample code for that provider.