Context
Datamailer owns delivery events, bounces, complaints, suppressions, and unsubscribe state. CMP should not be the delivery authority, but CMP needs selected event callbacks for support visibility and for syncing CMP-owned notification preferences when an unsubscribe maps to a CMP category.
Desired behavior
Datamailer can call a client webhook when relevant events happen:
POST <client webhook URL>
Suggested event types:
contact.hard_bounced
contact.complained
subscription.unsubscribed
subscription.resubscribed
transactional.skipped
transactional.failed
Payload should include:
- stable
event_id
event_type
occurred_at
- client and audience slugs
- email/contact id
- source object, such as campaign recipient or transactional message
- safe metadata, including preference category when available
Security
Use either a shared webhook token or signed headers with timestamp and HMAC.
Acceptance criteria
- Datamailer can configure a webhook URL/secret for a client.
- Events are sent idempotently with stable event IDs.
- Failed callbacks are retried asynchronously and visible in operator/debug views.
- Tests cover hard bounce, complaint, unsubscribe, transactional failure, duplicate events, and callback retry behavior.
Context
Datamailer owns delivery events, bounces, complaints, suppressions, and unsubscribe state. CMP should not be the delivery authority, but CMP needs selected event callbacks for support visibility and for syncing CMP-owned notification preferences when an unsubscribe maps to a CMP category.
Desired behavior
Datamailer can call a client webhook when relevant events happen:
Suggested event types:
contact.hard_bouncedcontact.complainedsubscription.unsubscribedsubscription.resubscribedtransactional.skippedtransactional.failedPayload should include:
event_idevent_typeoccurred_atSecurity
Use either a shared webhook token or signed headers with timestamp and HMAC.
Acceptance criteria