[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.
This commit is contained in:
38
connector-superoffice/attempt_agent_send.py
Normal file
38
connector-superoffice/attempt_agent_send.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv(override=True)
|
||||
from superoffice_client import SuperOfficeClient
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
sys.stdout.reconfigure(line_buffering=True)
|
||||
|
||||
def attempt_send(to_email: str):
|
||||
client = SuperOfficeClient()
|
||||
|
||||
# Payload for Agents/EMail/Send
|
||||
# It expects an array of "EMail" objects
|
||||
payload = [
|
||||
{
|
||||
"To": [{"Value": to_email, "Address": to_email}],
|
||||
"Subject": "Test from SuperOffice Agent API",
|
||||
"HTMLBody": "<h1>Hello!</h1><p>This is a test from the Agents/EMail/Send endpoint.</p>",
|
||||
"From": {"Value": "system@roboplanet.de", "Address": "system@roboplanet.de"} # Try to force a sender
|
||||
}
|
||||
]
|
||||
|
||||
print(f"🚀 Attempting POST /Agents/EMail/Send to {to_email}...")
|
||||
try:
|
||||
# Note: The endpoint might be v1/Agents/EMail/Send
|
||||
res = client._post("Agents/EMail/Send", payload)
|
||||
if res:
|
||||
print("✅ Success! Response:", json.dumps(res, indent=2))
|
||||
else:
|
||||
print("❌ Request failed (None returned).")
|
||||
except Exception as e:
|
||||
print(f"❌ Exception during send: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
attempt_send("floke.com@gmail.com")
|
||||
Reference in New Issue
Block a user