api-python-sdk/examples/send_email.py
2026-11-28 15:28:07 +02:00

18 lines
520 B
Python

"""Send one e-mail through the E-mail Center."""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) # run from the repository without installing
from mozout import Client, ApiError
# Key from MOZOUT_API_KEY.
client = Client()
mail = client.email_center.messages_create({
"from": "Example <notifications@example.com>",
"to": ["ana@example.org"],
"subject": "Your order is ready",
"text": "Hello Ana, your order is ready to collect.",
})
print(mail["data"])