Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unisender Go: Fix status tracking webhook and tests. #401

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

medmunds
Copy link
Contributor

@medmunds medmunds commented Sep 8, 2024

See #398. Replaces #397.

Rework Unisender Go tracking webhook to fix several problems (see commit message).

This also reworks test_unisender_go_webhooks.py to follow the format of our other webhook tests and add several missing cases.

- Fix signature checking to avoid false validation errors
  on webhook payloads including `/` (including all "clicked"
  and most "opened" events). And in general, avoid depending
  on specific details of Unisender Go's JSON serialization.
  (Fixes #398.)
- Handle "use single event" webhook option (which has a different
  payload format).
- Verify basic auth when Anymail's WEBHOOK_SECRET is used.
  (This is optional for Unisender Go, since payloads are signed,
  but it needs to be checked when enabled.)
- Treat "soft_bounced" events as "deferred" rather than "bounced",
  since they will be retried later.
- Update validation error to reference Project ID if the webhook
  is configured for a specific project.
- Expose Unisender Go's delivery_status code and unsubscribe form
  comment as Anymail's normalized event.description.
- Update webhook tests based on actual payloads and add several
  missing tests.
- Update docs to clarify webhook use with Unisender Go projects.
@medmunds medmunds merged commit e4331d2 into main Sep 8, 2024
49 checks passed
@medmunds medmunds deleted the fix/unisender-go-webhook branch September 8, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant