The official Python client for sending emails via the SendSculpt Mailer API.
Requires Python 3.7+ and requests
Installation
Install via pip:
Quick Start
Initialize the client with your API Key.
from sendsculpt import SendSculptClient
client = SendSculptClient(api_key="your-api-key")
response = client.send_email(
to=["recipient@example.com"],
subject="Welcome to SendSculpt!",
from_email="noreply@yourdomain.com",
body_text="Hello! This is a test email from the SendSculpt Python SDK."
)
print(response)
Advanced Usage
Send emails utilizing SendSculpt Templates and auto-encoded Attachments.
from sendsculpt import SendSculptClient
client = SendSculptClient(api_key="your-api-key")
response = client.send_email(
to=["john@doe.com"],
subject="Your Invoice",
from_email="billing@yourdomain.com",
template_id="uuid-of-your-template",
template_data={
"first_name": "John",
"invoice_amount": "49.99"
},
cc=["accounts@doe.com"],
attachments=[
{
"filename": "invoice.pdf",
"file_path": "/path/to/local/invoice.pdf", # Auto-converted to Base64
"mime_type": "application/pdf"
}
]
)
print("Email queued successfully:", response['message_id'])
For local development, initialize the client with the base_url: SendSculptClient(api_key="key", base_url="https://api.sendsculpt.com/api/v1").