Metadata-Version: 2.3
Name: nyxa-mail
Version: 0.1.0
Summary: Batteries-included mail for Nyxa — log/smtp default, optional SES/Mailgun
Keywords: fastapi,mail,smtp,nyxa
Author: Al-Amin Islam Nerob
Author-email: Al-Amin Islam Nerob <alamin@aincoder.com>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Dist: nyxa>=0.1.0
Requires-Dist: httpx>=0.27 ; extra == 'mailgun'
Requires-Dist: boto3>=1.34 ; extra == 'ses'
Requires-Python: >=3.11
Project-URL: Homepage, https://nyxadev.com
Project-URL: Repository, https://github.com/NyxaDev/nyxa
Provides-Extra: mailgun
Provides-Extra: ses
Description-Content-Type: text/markdown

# nyxa-mail — batteries-included mail for Nyxa

Log/file mailer by default (no SMTP required). Optional SMTP, **SES**, and **Mailgun**.

## At a glance

| What you need | Nyxa Mail |
| --- | --- |
| Reusable message class | `nyxa_mail.Mailable` |
| Send a message | `mail.send(mailable)` |
| Local dev without SMTP | `MAIL_MAILER=log` (writes `storage/logs/mail/`) |
| SMTP delivery | `MAIL_MAILER=smtp` + `MAIL_HOST` / `MAIL_PORT` / … |
| SES / Mailgun | `MAIL_MAILER=ses` / `mailgun` + extras |

## Install

```bash
uv add nyxa-mail
uv add 'nyxa-mail[ses]'      # boto3
uv add 'nyxa-mail[mailgun]'  # httpx
```

## Quick start

```python
from nyxa_mail import Mailable, mail

class WelcomeMail(Mailable):
    def __init__(self, name: str) -> None:
        super().__init__()
        self.name = name

    def text(self) -> str:
        return f"Welcome, {self.name}!\n"

mail.send(WelcomeMail("Ada").to("ada@example.com").subject("Welcome"))
```

## Configuration

```bash
MAIL_MAILER=log
MAIL_FROM=app@example.com

# MAIL_MAILER=smtp
# MAIL_HOST=... MAIL_PORT=587 MAIL_USERNAME=... MAIL_PASSWORD=...

# MAIL_MAILER=ses
# AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_DEFAULT_REGION=us-east-1

# MAIL_MAILER=mailgun
# MAILGUN_DOMAIN=mg.example.com
# MAILGUN_API_KEY=key-...
# MAILGUN_API_BASE=https://api.eu.mailgun.net   # optional (EU)
```

## CLI

```bash
uv run nyxa mail test --to you@example.com
```
