JetEmail Python SDK for transactional email sending
Project description
JetEmail Python SDK
The official Python SDK for JetEmail transactional email.
Installation
pip install jetemail
Quick Start
from jetemail import JetEmail, SendEmailOptions
client = JetEmail(api_key="your_api_key")
result = client.emails.send(
SendEmailOptions(
from_="you@yourdomain.com",
to="recipient@example.com",
subject="Hello from JetEmail",
html="<p>Welcome!</p>",
)
)
print(result["id"])
Send an Email
from jetemail import JetEmail, SendEmailOptions, Attachment
client = JetEmail(api_key="your_api_key")
client.emails.send(
SendEmailOptions(
from_="You <you@yourdomain.com>",
to=["alice@example.com", "bob@example.com"],
subject="Monthly Report",
html="<h1>Report</h1><p>See attached.</p>",
text="Report - see attached.",
cc="manager@example.com",
bcc="archive@example.com",
reply_to="support@yourdomain.com",
headers={"X-Entity-Ref-ID": "report-2025-01"},
attachments=[
Attachment.from_path("/path/to/report.pdf"),
Attachment.from_content("raw,csv,data", "data.csv"),
],
)
)
Send Batch Emails
Send up to 100 emails in a single API call:
from jetemail import JetEmail, SendEmailOptions
client = JetEmail(api_key="your_api_key")
emails = [
SendEmailOptions(
from_="you@yourdomain.com",
to=recipient,
subject="Hello!",
html=f"<p>Hi {name}!</p>",
)
for name, recipient in [("Alice", "alice@example.com"), ("Bob", "bob@example.com")]
]
result = client.batch.send(emails)
print(result["summary"])
Webhook Verification
Verify incoming webhook signatures without a client instance:
from jetemail import verify_webhook
from jetemail.webhook_verification import WebhookSignatureVerificationFailed
try:
verify_webhook(
payload=request.body, # raw bytes
signature=request.headers["X-Webhook-Signature"],
timestamp=request.headers["X-Webhook-Timestamp"],
secret="your_webhook_secret",
tolerance=300, # seconds (default)
)
# Signature is valid
except WebhookSignatureVerificationFailed as e:
# Signature invalid or timestamp expired
print(e)
Error Handling
from jetemail import JetEmail, SendEmailOptions, JetEmailError
client = JetEmail(api_key="your_api_key")
try:
client.emails.send(
SendEmailOptions(
from_="you@yourdomain.com",
to="recipient@example.com",
subject="Test",
html="<p>Hi</p>",
)
)
except JetEmailError as e:
print(f"Status: {e.status_code}")
print(f"Message: {e.message}")
print(f"Response: {e.response}")
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jetemail-0.1.0.tar.gz.
File metadata
- Download URL: jetemail-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a1d18cc47ea60d4a8550033b2c7144d564785d082f7aef3b1b098ee18ca472e
|
|
| MD5 |
29c7c37b6c3df3f9efa18025720471a5
|
|
| BLAKE2b-256 |
16a8efbe23c87efb07215d29a15386eac924743e2a4d9ae6bad2671e737de198
|
Provenance
The following attestation bundles were made for jetemail-0.1.0.tar.gz:
Publisher:
publish.yml on jetemail/jetemail-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jetemail-0.1.0.tar.gz -
Subject digest:
7a1d18cc47ea60d4a8550033b2c7144d564785d082f7aef3b1b098ee18ca472e - Sigstore transparency entry: 1212396856
- Sigstore integration time:
-
Permalink:
jetemail/jetemail-python@64be129fc2f59b5808262bd9b627a5431188e4d4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jetemail
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64be129fc2f59b5808262bd9b627a5431188e4d4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jetemail-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jetemail-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89b77d4bc806dfca27fd997bbb6a363056f83d06d3d8f7cb8f70fdc80d3b6871
|
|
| MD5 |
ac9eaed84e03dda24d6bdd4583a7c21c
|
|
| BLAKE2b-256 |
f2c5384dc529d1cb30ad3e1a3a56bbc07941f168a205751c05e41d89504cd30e
|
Provenance
The following attestation bundles were made for jetemail-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on jetemail/jetemail-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jetemail-0.1.0-py3-none-any.whl -
Subject digest:
89b77d4bc806dfca27fd997bbb6a363056f83d06d3d8f7cb8f70fdc80d3b6871 - Sigstore transparency entry: 1212396957
- Sigstore integration time:
-
Permalink:
jetemail/jetemail-python@64be129fc2f59b5808262bd9b627a5431188e4d4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jetemail
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64be129fc2f59b5808262bd9b627a5431188e4d4 -
Trigger Event:
release
-
Statement type: