Skip to content

feat: add the inbound.rejected webhook event - #45

Merged
bjarn merged 1 commit into
mainfrom
feat/inbound-rejected-webhook-event
Oct 28, 2026
Merged

bjarn merged 1 commit into
mainfrom
feat/inbound-rejected-webhook-event

Conversation

@bjarn

@bjarn bjarn commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What changed

  • WebhookEvent gains "inbound.rejected". Webhooks can subscribe to it, and the API sends it when an inbound message is rejected during SMTP.
  • Only the generated types change. No new methods, no new fields, no signature changes.
  • WebhookEvent already accepted unknown event names as str, so this only adds the literal for type checkers and documents the event.

Non-breaking. Target: minor.

API changes in the regenerated types

Type Change Python
WebhookEvent gains the value inbound.rejected Literal["inbound.rejected"] member

The spec's openapi version string moved from 3.1.0 to 3.1.2. That has no effect on the SDK.

Usage

lettermint.webhooks.create(
    {
        "name": "Rejected inbound mail",
        "url": "https://example.com/webhooks/lettermint",
        "events": ["inbound.rejected"],
    }
)

# In the webhook handler:
webhook = Webhook(os.environ["LETTERMINT_WEBHOOK_SECRET"])
event = webhook.verify(raw_body, headers)
if event["event"] == "inbound.rejected":
    ...

Checks

Python 3.14.6, after pip install -e ".[dev]":

  • python -m ruff check src tests scripts: passed
  • python -m ruff format --check src tests scripts: 28 files already formatted
  • python -m mypy: no issues in 35 source files
  • python scripts/unasync.py --check: _sync up to date
  • python scripts/generate.py --check: generated files up to date with the pinned spec. The header-only mode that CI runs also passes.
  • python -m pytest tests/: 305 passed

The same test job (ruff, mypy, unasync and generate checks, pytest) on Python 3.10.20, 3.11.13, 3.12.11 and 3.13.4: passed, 305 tests each.

Build job, Python 3.12.11:

  • python -m build: sdist and wheel built
  • python -m twine check --strict dist/*: passed
  • installed the wheel in a fresh venv and ran the CI smoke script: UPGRADE.md and py.typed present, client constructs

Not run locally

Nothing. Every CI step was run locally.

Suggested release tag

v3.3.0

@bjarn
bjarn requested a review from a team as a code owner October 28, 2026 14:39
@bjarn
bjarn merged commit 66109b0 into main Oct 28, 2026
7 checks passed
@bjarn
bjarn deleted the feat/inbound-rejected-webhook-event branch October 28, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants