Skip to main content

Generated Python client for the Sendmux Sending API.

Project description

sendmux-sending

PyPI version Python versions PyPI downloads Licence

Generated Python client for the Sendmux Sending API.

Documentation

Requirements

  • Python 3.10 or newer.
  • A send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token.

Installation

pip install sendmux-sending

Usage

import os

from sendmux_sending import Address, EmailSendRequest, EmailsApi, create_sending_client

client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])
api = EmailsApi(client)

response = api.sending_send_email(
    EmailSendRequest(
        var_from=Address(email="sender@example.com"),
        to=Address(email="recipient@example.com"),
        subject="Hello from Sendmux",
        html_body="<p>Hello.</p>",
        text_body="Hello.",
    ),
    idempotency_key="email_123",
)

print(response.data.message_id)

The package exports every generated Sending model and API class plus:

  • create_sending_client
  • configure_sending
  • SendmuxSendingApiClient
  • file helpers: attachment_from_file and send_email_with_files

Attachments

The Sending API accepts attachment content in the request body. It supports up to 10 attachments and rejects request bodies over 25 MB. Avoid manual base64 encoding by using the file helpers:

import os

from sendmux_sending import create_sending_client, send_email_with_files

client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])

send_email_with_files(
    client,
    files=["./report.pdf"],
    idempotency_key="report-123",
    body={
        "from": {"email": "sender@example.com"},
        "to": {"email": "recipient@example.com"},
        "subject": "Report",
        "html_body": "<p>Attached.</p>",
    },
)

Request helpers

Use sendmux-core when you need explicit idempotency, conditional request, pagination, retry, or typed-error helpers. The generated Sending client already uses the shared retry and error mapper.

Support

Open an issue in Sendmux/sendmux-sdk with the package name, version, and request ID from any API error.

Licence

MIT. See the licence file.

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

sendmux_sending-1.2.0.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

sendmux_sending-1.2.0-py3-none-any.whl (54.4 kB view details)

Uploaded Python 3

File details

Details for the file sendmux_sending-1.2.0.tar.gz.

File metadata

  • Download URL: sendmux_sending-1.2.0.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for sendmux_sending-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8dcb71ac7a00ce5952b38a418d6bbee949aad23f604b612e57537a32895576e4
MD5 d70efa65e28247ccd069ecef028e4711
BLAKE2b-256 69a48df11ae1c5d6df08a861a9046a8c1a17ccdd3181692b274b8e689b29af15

See more details on using hashes here.

Provenance

The following attestation bundles were made for sendmux_sending-1.2.0.tar.gz:

Publisher: release-please.yml on Sendmux/sendmux-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sendmux_sending-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sendmux_sending-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c99506507ace75a4d13ab3fb32384a42696b1f433f5cd6a11e568df49dc2f361
MD5 46ac8cbd15e1ab92121de90f60a0b8f4
BLAKE2b-256 5c965c9b2a354a2b60551c562cc2c0d3935f5907c72409873fcc59559841d115

See more details on using hashes here.

Provenance

The following attestation bundles were made for sendmux_sending-1.2.0-py3-none-any.whl:

Publisher: release-please.yml on Sendmux/sendmux-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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