Skip to main content

Developer friendly Python SDK for OpenMail

Project description

OpenMail Python SDK

A lightweight, developer-friendly SDK for OpenMail.

Install

pip install openmail-sdk

Quick Start

from openmail import OpenMailClient

client = OpenMailClient(
    api_key="your_api_key",
    token_url="https://openmail.openproject.co.zw/r/your_token"
)

response = client.send_email(
    to_email="user@example.com",
    subject="Hello from OpenMail",
    type="html",
    body="<h1>Hello</h1><p>Welcome.</p>"
)

print(response)

Bulk Emails

You can send bulk emails in a single request. The SDK normalizes inputs (supporting either to or to_email, and body or html/text structures).

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

# Can be a list of emails, or a dict structured as {"emails": [...]}
response = client.send_bulk_emails(emails)
print(response)

Core Inputs

  • api_key
  • token_url

These are the only required values to initialize the SDK client.

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

openmail_sdk-1.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

openmail_sdk-1.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file openmail_sdk-1.1.0.tar.gz.

File metadata

  • Download URL: openmail_sdk-1.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for openmail_sdk-1.1.0.tar.gz
Algorithm Hash digest
SHA256 06b28e3a036e1918e914a47fa2985900d825821e8c18e06b17acf6b783ff3db8
MD5 55b412c501c8ab02722d700eec134270
BLAKE2b-256 6c5ee9c6ff5936b48971f4aff4f8b76c0a6b561d7fad0eb8e88dfe35391146cc

See more details on using hashes here.

File details

Details for the file openmail_sdk-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: openmail_sdk-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for openmail_sdk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4b9a08365f6d24bf2f8c1e1cebea003ea21b1a17ed6f3f9538870edb8dd35f5
MD5 e4436d71c09b3790699a465ae5118778
BLAKE2b-256 791de0de3261351262a824667b0f8f29c47a03cbacdaaeaa6e6a3427e77e356f

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