18 lines
527 B
Python
18 lines
527 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 interweb_ao import Client, ApiError
|
|
|
|
# Key from INTERWEB_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"])
|