Metadata-Version: 2.5
Name: render-lab-tasks-resend
Version: 0.1.0
Summary: resend tasks for Render Workflows
Project-URL: Repository, https://github.com/render-lab/render-tasks-python
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: render-lab-tasks-core<0.2,>=0.1.1
Requires-Dist: render==1.0.1
Description-Content-Type: text/markdown

# render-lab-tasks-resend

Python port of all 10 registered tasks in the pinned TypeScript pack at
`45f9c2d44bd28e01ae9813e0d2ff56ee6c533816`. Python 3.12+.

Install this distribution and its dependencies:

```sh
pip install render-lab-tasks-resend==0.1.0
```

Import definitions from `render_lab_tasks_resend.tasks`; combine `app` objects
with `Workflows.from_workflows(...)`. JSON fields retain TS spelling; functions
use snake_case. Package root imports are inert.

## Tasks

| Registered name | Python export (also exposes `_impl`) |
| --- | --- |
| `resend.addContact` | `add_contact` |
| `resend.awaitReply` | `await_reply` |
| `resend.createBroadcast` | `create_broadcast` |
| `resend.getDeliveryStatus` | `get_delivery_status` |
| `resend.listAudiences` | `list_audiences` |
| `resend.send` | `send` |
| `resend.sendBatch` | `send_batch` |
| `resend.sendBroadcast` | `send_broadcast` |
| `resend.template` | `template` |
| `resend.verifyWebhook` | `verify_webhook` |

## Dependencies and retries

Raw implementations accept context first and keyword-only `deps`. The `.client`
module exports typed `Port`, `Deps`, and `Client` classes. Inject a fake port, or
pass a caller-owned `httpx.AsyncClient` to `Client`. Default dependencies close
their client after one operation. Credentials resolve at first use. Transport
retries are disabled; `retry.py` owns durable policies. DTO types are in `.types`.
Requires core >=0.1.1.

## Environment

| Variable | Contract |
| --- | --- |
| `RESEND_API_KEY` | Required for management/read operations. send/sendBatch log to console when absent. |
| `RESEND_WEBHOOK_SECRET` | Required for verifyWebhook unless input.secret is supplied. |

## Verification and limitations

send/sendBatch preserve the console fallback when no key is set; delivered=false
means no email was delivered. Management operations require a key. awaitReply has
no default inbox: inject `Deps(resend=..., inbox=...)` whose InboxPort implements
`find_reply(input)` and returns a ReplyDTO or None. It polls once per attempt.
verifyWebhook validates Svix HMAC signatures; as in TS, it does not check timestamp
freshness or deduplicate event IDs. The caller must provide replay protection.
Template rendering escapes HTML. Sending operations retain four retries without
an idempotency key; use test recipients until live duplicate-handling is proven.

Shared fixtures execute the actual pinned TS implementations and compare Python
outputs and requests. Sanity's SDK calls are translated into separately asserted
REST requests. These are hermetic checks, not real account or hosted verification.
See [the testing backlog](https://github.com/render-lab/render-tasks-python/issues/1)
and the root verification tracker. Licensed under MIT.
