Skip to content

Send delivery, suppression, and unsubscribe callbacks to CMP #60

@alexeygrigorev

Description

@alexeygrigorev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions