Metadata-Version: 2.4
Name: python-axon-resend
Version: 1.0.0
Summary: Resend.com mail driver vendor module for the Axon Framework
License: MIT
Project-URL: Homepage, https://github.com/yourorg/python-axon-resend
Project-URL: Repository, https://github.com/yourorg/python-axon-resend
Keywords: axon,framework,resend,email,mail
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: python-axon>=1.0.0
Requires-Dist: resend>=2.0.0

# python-axon-resend

Resend.com transactional email driver for the [Axon Framework](https://github.com/yourorg/axon-framework).

## Install

```bash
pip install python-axon-resend
```

## Register

In your project's `app/providers/providers.py`:

```python
from axon import VendorProvider

providers = [
    VendorProvider.use("resend"),
]
```

## Publish config stubs

```bash
./manage vendor:publish resend
```

This writes the required env vars into `.env.example`. Copy to `.env` and fill in:

```env
RESEND__API_KEY=re_your_key_here
RESEND__FROM=MyApp <no-reply@yourdomain.com>
```

## Usage

After registration, `make(Mailer)` anywhere in your app returns `ResendMailer`:

```python
from axon import make
from axon.core.mail.mailer import Mailer

mailer = make(Mailer)

# Send immediately
mailer.send(
    to="user@example.com",
    subject="Welcome!",
    body="<h1>Thanks for signing up.</h1>",
)

# Send in background (retries on failure)
mailer.queue(
    to="user@example.com",
    subject="Your weekly report",
    body="<p>Here is your report...</p>",
    delay=0,
)
```

Because it overrides the platform `Mailer` binding, every module that injects `Mailer` automatically uses Resend — no changes to existing module code.

## All commands

```bash
./manage vendor:list              # show all installed vendors
./manage vendor:publish resend    # write env stubs to .env.example
```
