Metadata-Version: 2.5
Name: django-sesy
Version: 0.1.0
Summary: Django email backend integration for SESY email service
Project-URL: Homepage, https://sesy.email
Project-URL: Documentation, https://sesy.email/docs/django
Project-URL: Source, https://github.com/denibertovic/django-sesy
Project-URL: Tracker, https://github.com/denibertovic/django-sesy/issues
Author: Deni Bertovic
License-Expression: MIT
License-File: LICENSE
Keywords: backend,django,django-sesy,email,ses,sesy
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Email
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: django>=4.1
Requires-Dist: sesy>=0.1.0
Provides-Extra: dev
Requires-Dist: django-stubs>=4.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-django>=4.5.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# SESY Django Integration

Django email backend for the SESY email service.

## Installation

```bash
uv add django-sesy
```

Or with pip:

```bash
pip install django-sesy
```

The `sesy` client library is installed as a dependency.

## Configuration

```python
# settings.py
EMAIL_BACKEND = 'django_sesy.SesyEmailBackend'
SESY_API_KEY = 'your-api-key'
SESY_BASE_URL = 'https://sesy.email'  # Optional
```

## Usage

### Standard Django Email

```python
from django.core.mail import send_mail

send_mail(
    'Subject',
    'Plain text body',
    'from@example.com',
    ['to@example.com'],
)
```

### HTML Email

```python
from django.core.mail import EmailMultiAlternatives

message = EmailMultiAlternatives(
    subject='Welcome',
    body='Plain text version',
    from_email='from@example.com',
    to=['to@example.com'],
)
message.attach_alternative('<h1>HTML version</h1>', 'text/html')
message.send()
```

### Template Email

```python
from django_sesy import SesyTemplateMessage

message = SesyTemplateMessage(
    template='welcome',
    to=['user@example.com'],
    data={'name': 'John'},
    tags={'campaign': 'onboarding'},
)
message.send()
```

## Custom Tags

Add custom tags via headers:

```python
from django.core.mail import EmailMessage

message = EmailMessage(
    subject='Tagged Email',
    body='Body',
    to=['to@example.com'],
    headers={
        'X-SESY-Tag-Campaign': 'newsletter',
        'X-SESY-Idempotency-Key': 'unique-123',
    },
)
message.send()
```
