This guide covers upgrading from the latest released v1 Python SDK to v2.
- Sending email now lives behind
Lettermint.email(token). - The full Lettermint API is available through
Lettermint.api(token). - Sending tokens use
x-lettermint-token; full API tokens useAuthorization: Bearer. ping()returns the raw trimmedpongresponse.- Request and response shapes are generated from the OpenAPI specs as
TypedDict/Literaltypes.
from lettermint import Lettermint
email = Lettermint.email("sending-token")
api = Lettermint.api("api-token")Existing Lettermint(api_token="...").email sending usage still works.
email.send_batch([
{"from": "sender@example.com", "to": ["user@example.com"], "subject": "Hello", "text": "Hi"}
])domains = api.domains.list()
message_html = api.messages.html("message-id")