Metadata-Version: 2.3
Name: notify-emailer
Version: 0.5.0
Summary: Send templated error notification emails via SMTP
Author: Ben Nicholls
Author-email: Ben Nicholls <benjnicholls@pm.me>
License: Copyright 2026 Ben Nicholls
         
         Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# notify-emailer

Small Python library. Sends HTML error-alert emails through SMTP.

Email includes application name, local timestamp, error message, and error details.

## Install

Requires Python 3.9+.

```bash
pip install notify-emailer
```

Or install local checkout:

```bash
pip install .
```

## Use

```python
from notify_emailer.config import Config
from notify_emailer.sender import EmailNotifier

config = Config(
    server="smtp.example.com",
    port=25,
    from_addr="alerts@example.com",
    to_addr="ops@example.com",
    application="billing-api",
)

notifier = EmailNotifier(config)
notifier.send_error_email(
    error_message="Database connection failed",
    error_details="Timeout while connecting to db.internal:5432",
)
```

Set custom subject when needed:

```python
config = Config(
    server="smtp.example.com",
    port=25,
    from_addr="alerts@example.com",
    to_addr="ops@example.com",
    application="billing-api",
    subject="Billing API error",
)
```

## Config

| Field | Meaning |
| --- | --- |
| `server` | SMTP hostname or IP address |
| `port` | SMTP port |
| `from_addr` | Sender email address |
| `to_addr` | Recipient email address |
| `application` | Name shown in email |
| `subject` | Email subject; default: `App Error Notification` |

## SMTP behavior

Uses plain `smtplib.SMTP`. No authentication, TLS/STARTTLS, or retry logic built in. Configure server/network accordingly, or extend notifier for authenticated/encrypted SMTP.

## License

MIT. See [LICENSE](LICENSE).
