Skip to main content

Official Python SDK for SendIX email platform

Project description

sendix-python

Official Python SDK for SendIX — Email infrastructure for developers.

Installation

pip install sendix-python

Quick Start

from sendix import SendIX

client = SendIX('sk_live_your_api_key')

# Send a single email
result = client.emails.send({
    'to': 'user@example.com',
    'subject': 'Hello from SendIX',
    'html': '<p>Hello world</p>',
})

# Send with template variables
result = client.emails.send({
    'to': 'user@example.com',
    'subject': 'Hi {{name}}',
    'html': '<p>Hi {{name}}, welcome!</p>',
    'variables': {'name': 'Alice'},
})

# Send bulk emails
result = client.emails.send_batch({
    'emails': [
        {'to': 'user1@example.com', 'subject': 'Hi {{name}}', 'html': '<p>Hi {{name}}</p>', 'variables': {'name': 'Alice'}},
        {'to': 'user2@example.com', 'subject': 'Hi {{name}}', 'html': '<p>Hi {{name}}</p>', 'variables': {'name': 'Bob'}},
    ],
})

# Async usage
import asyncio

async def main():
    result = await client.emails.async_send({
        'to': 'user@example.com',
        'subject': 'Async email',
        'html': '<p>Sent async</p>',
    })

asyncio.run(main())

Error Handling

from sendix import SendIX, AuthenticationError, SendIXError

client = SendIX('sk_live_your_api_key')

try:
    result = client.emails.send({
        'to': 'user@example.com',
        'subject': 'Test',
        'html': '<p>Test</p>',
    })
except AuthenticationError as e:
    print(f'Auth error: {e.message}')
except SendIXError as e:
    print(f'Error {e.status}: {e.message} (code: {e.code})')

API Reference

SendIX(api_key, base_url="https://api.sendix.io")

Method Description
emails.send(options) Send a single email
emails.send_batch(options) Send multiple emails
emails.list(options) List sent emails
emails.get(email_id) Get a single email
webhooks.create(options) Create a webhook
webhooks.list() List all webhooks
webhooks.delete(webhook_id) Delete a webhook
webhooks.deliveries() Get webhook delivery logs

Every sync method has an async_ counterpart for use with asyncio.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sendix_python-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sendix_python-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file sendix_python-0.1.0.tar.gz.

File metadata

  • Download URL: sendix_python-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for sendix_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d35451cc7282f7de42d715e6375efbd4f4525f9211335134aec0fd87c8373ef
MD5 53f8bfa3f280a1644f21eb9446d71d42
BLAKE2b-256 3c390880a125b58e549e152d8dfeb50ccbc9dc63f33aa6f281282af5ca2e398e

See more details on using hashes here.

File details

Details for the file sendix_python-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sendix_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for sendix_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f6e07b5911d0d21ace841c2b649010a4428d1fdec0d953dda1edb6dc766e331
MD5 bbfb78bcc77b461d566e8336339b3751
BLAKE2b-256 6a64e3d74175b4e0b5b40e12b41ce8eb2ae176f1ebeba79ebab274a69a87167a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page