Metadata-Version: 2.4
Name: sendpulse-sdk
Version: 1.0.0
Summary: Developer friendly Python SDK for SendPulse Email REST API
Author: OpenMail
License: MIT
Keywords: sendpulse,email,sdk,api
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
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: Topic :: Communications :: Email
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0

# SendPulse Python SDK

A lightweight, developer-friendly SDK for SendPulse Email REST API.

## Install

```bash
pip install sendpulse-sdk
```

## Quick Start

```python
from sendpulse import SendPulseClient

client = SendPulseClient(
    client_id="your_client_id",
    client_secret="your_client_secret"
)

response = client.send_email(
    to_email="recipient@example.com",
    subject="Hello from SendPulse SDK",
    body="<h1>Hello!</h1><p>Welcome to SendPulse transactional email integration.</p>",
    from_email="sender@yourverifieddomain.com",
    from_name="Your Company Name"
)

print(response)
```

## Bulk Emails

You can send bulk emails in a single request. The SDK normalizes the inputs and executes sending requests sequentially, returning a summary of the results.

```python
emails = [
    {
        "to_email": "user1@example.com",
        "subject": "Hello User 1",
        "body": "<h1>Welcome</h1><p>This is HTML content.</p>",
        "type": "html"
    },
    {
        "to": "user2@example.com",
        "subject": "Hello User 2",
        "body": "This is plain text content.",
        "type": "text"
    }
]

response = client.send_bulk_emails(
    emails=emails,
    from_email="sender@yourverifieddomain.com",
    from_name="Your Company Name"
)
print(response)
```

## Health Check

To test connection or verify that your Client ID and Client Secret are correct:

```python
health_info = client.health()
print(health_info)
```

## Core Parameters

- `client_id`: OAuth Client ID (obtainable in your SendPulse account settings > API).
- `client_secret`: OAuth Client Secret (obtainable in your SendPulse account settings > API).
- `api_url`: Base URL for SendPulse REST API, defaults to `https://api.sendpulse.com`.
- `timeout`: Request timeout in seconds, defaults to `30`.
