Files
microdao-daarion/tools/agent_email/tests/test_send_email.py
Apple 129e4ea1fc feat(platform): add new services, tools, tests and crews modules
New router intelligence modules (26 files): alert_ingest/store, audit_store,
architecture_pressure, backlog_generator/store, cost_analyzer, data_governance,
dependency_scanner, drift_analyzer, incident_* (5 files), llm_enrichment,
platform_priority_digest, provider_budget, release_check_runner, risk_* (6 files),
signature_state_store, sofiia_auto_router, tool_governance

New services:
- sofiia-console: Dockerfile, adapters/, monitor/nodes/ops/voice modules, launchd, react static
- memory-service: integration_endpoints, integrations, voice_endpoints, static UI
- aurora-service: full app suite (analysis, job_store, orchestrator, reporting, schemas, subagents)
- sofiia-supervisor: new supervisor service
- aistalk-bridge-lite: Telegram bridge lite
- calendar-service: CalDAV calendar service with reminders
- mlx-stt-service / mlx-tts-service: Apple Silicon speech services
- binance-bot-monitor: market monitor service
- node-worker: STT/TTS memory providers

New tools (9): agent_email, browser_tool, contract_tool, observability_tool,
oncall_tool, pr_reviewer_tool, repo_tool, safe_code_executor, secure_vault

New crews: agromatrix_crew (10 modules: depth_classifier, doc_facts, doc_focus,
farm_state, light_reply, llm_factory, memory_manager, proactivity, reflection_engine,
session_context, style_adapter, telemetry)

Tests: 85+ test files for all new modules
Made-with: Cursor
2026-03-03 07:14:14 -08:00

61 lines
1.3 KiB
Python

"""
Test 1: Send Email
Demonstrates creating an inbox and sending an email.
"""
import os
import sys
sys.path.insert(0, ".")
from agent_email import AgentEmailTool
# Set API key (use env var or set directly)
os.environ["AGENTMAIL_API_KEY"] = "your-api-key-here"
def test_send_email():
"""Test sending an email"""
# Initialize tool
tool = AgentEmailTool(agent_id="sofiia-test")
# Create inbox (or use existing)
print("Creating inbox...")
inbox = tool.create_inbox(
username="sofiia-test",
display_name="Sofiia Test Agent"
)
print(f"Inbox created: {inbox['email_address']}")
# Send email
print("\nSending email...")
result = tool.send(
to=["recipient@example.com"],
subject="Test from Sofiia Agent",
body="""Hello!
This is a test email sent from Sofiia Agent via AgentMail.
Best regards,
Sofiia""",
html="""<html>
<body>
<p>Hello!</p>
<p>This is a test email sent from <strong>Sofiia Agent</strong> via AgentMail.</p>
<p>Best regards,<br>Sofiia</p>
</body>
</html>"""
)
print(f"Email sent: {result['message_id']}")
print(f"Status: {result['status']}")
return result
if __name__ == "__main__":
try:
test_send_email()
except Exception as e:
print(f"Error: {e}")