Metadata-Version: 2.4
Name: resent
Version: 0.1.0
Summary: Official Python SDK for Resent transactional email
Project-URL: Homepage, https://resent.one
Project-URL: Documentation, https://developers.resent.one/sdks/python
Project-URL: Repository, https://github.com/resentmail/resent-python
Project-URL: Issues, https://github.com/resentmail/resent-python/issues
Author-email: Resent <hello@resent.one>
License-Expression: MIT
License-File: LICENSE
Keywords: api,email,resent,sdk,transactional
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications :: Email
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown

<p align="center">
  <img
    alt="Send emails with Python — Resent"
    src="https://raw.githubusercontent.com/resentmail/resent-python/main/assets/banner.jpg?v=0.1.0"
    width="100%"
  />
</p>

<p align="center">
  <a href="https://pypi.org/project/resent/"><img alt="PyPI" src="https://img.shields.io/pypi/v/resent?color=b6ff5a&label=pypi&style=flat-square" /></a>
  <a href="https://pypi.org/project/resent/"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/resent?style=flat-square" /></a>
  <a href="https://github.com/resentmail/resent-python/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-b6ff5a?style=flat-square" /></a>
  <a href="https://developers.resent.one/sdks/python"><img alt="Docs" src="https://img.shields.io/badge/docs-developers.resent.one-111?style=flat-square" /></a>
</p>

<p align="center">
  <a href="https://developers.resent.one">Documentation</a>
  ·
  <a href="https://resent.one">Website</a>
  ·
  <a href="https://pypi.org/project/resent/">PyPI</a>
  ·
  <a href="https://github.com/resentmail/resent-python">GitHub</a>
</p>

# Resent Python SDK

The official Python library for [Resent](https://resent.one) transactional email.

## Install

```bash
pip install resent
```

## Setup

1. Verify a sending domain in the [Resent dashboard](https://resent.one/app/settings/domains/)
2. Create an API key under [Settings → API keys](https://resent.one/app/settings/api-keys/)
3. Store it as `RESENT_API_KEY`

```python
import os
from resent import Resent

resent = Resent(os.environ["RESENT_API_KEY"])
```

## Usage

```python
import os
from resent import Resent

resent = Resent(os.environ["RESENT_API_KEY"])

result = resent.emails.send(
    from_="Acme <noreply@yourdomain.com>",
    to="you@example.com",
    subject="Hello World",
    html="<p>Congrats on sending your <strong>first email</strong> with Resent!</p>",
)

print(result.submission_id)
```

## Send email using HTML

```python
result = resent.emails.send(
    from_="Acme <noreply@yourdomain.com>",
    to=["you@example.com"],
    subject="Hello World",
    html="<strong>It works!</strong>",
)
```

## Send email using text

```python
result = resent.emails.send(
    from_="Acme <noreply@yourdomain.com>",
    to="you@example.com",
    subject="Hello World",
    text="It works!",
)
```

## Docs

- [Getting started](https://developers.resent.one)
- [Send transactional email](https://developers.resent.one/guides/send-transactional-email)
- [Python SDK docs](https://developers.resent.one/sdks/python)
- [API overview](https://developers.resent.one)

## License

MIT © [Resent](https://resent.one)
