Codemail para Python
pip install codemail-sdk
from codemail import Codemail, Attachment
cm = Codemail("cm_live_...") # ou defina CODEMAIL_API_KEY
r = cm.emails.send(
from_="alerta@meudominio.com.br", # precisa ser do domínio da chave
to="ana@cliente.com", # um endereço ou uma lista
subject="Seu pedido foi enviado",
html="<p>Olá!</p>",
attachments=[Attachment.from_file("nota.pdf")],
)
print(r.id, r.status) # status: queued (o envio é assíncrono)
cm.emails.get(r.id).status # queued, sent, delivered, bounced...
cm.emails.events(r.id) # linha do tempo
cm.emails.list(status="bounced", limit=20)
- Idempotente por padrão: cada
sendleva umIdempotency-Keye o repete nas retentativas, então um timeout nunca vira dois e-mails. Passeidempotency_key="..."para controlar você mesmo. - Retentativas: erro de rede, 429 (respeita
Retry-After) e 5xx, atémax_retries(padrão 2). - Erros tipados:
AuthenticationError,PermissionDeniedError,NotFoundError,InvalidRequestError(paramdiz o campo),RateLimitError(retry_after),ServerError,APIConnectionError. - Sem dependências. Python 3.9+.
Metadata
Release files for codemail-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| codemail_sdk-0.1.0.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codemail_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / codemail_sdk-0.1.0.tar.gz
| Download URL | codemail_sdk-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d2cbcda8f5904da489702622938ad8cfe0f9050ccd4fd3600ba02a6bf623d3a
|
|
BLAKE2b-256 checksum How to use checksums |
0c283effd4ebb9d9fcd2cfbab81c048f99454573e985ff08d4cad40b4d981cbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / codemail_sdk-0.1.0-py3-none-any.whl
| Download URL | codemail_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b33df0cf76beb8b96abcb87c96620fe1e10b17caf70c3450dcd396442c1230d2
|
|
BLAKE2b-256 checksum How to use checksums |
f5d43ba76fc1a8292fccfaa822cebb0addaf171e8933fa77f7a690abb59f622a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|