AI Support Agent That Carries Context Between Email and WhatsApp (Python) Telnyx published a Python code example, email-whatsapp-support-python, that demonstrates a unified customer support dashboard carrying context across Email and WhatsApp channels using Telnyx APIs. The demo runs without Telnyx credentials via `pip install -r requirements.txt` and `python demo/demo_server.py`, serving a four-panel dashboard at http://localhost:5050 that walks through a scripted journey from a damaged-headphones report to order status transitions of delivered → damage_reported → replacement_shipping → resolved. Production use requires copying .env.example to .env with real credentials, running app.py, and configuring the /webhooks/email and /webhooks/whatsapp endpoints. A unified dashboard demo showing customer support across Email and WhatsApp channels using Telnyx https://telnyx.com APIs. Scenario : A customer reports a damaged order via email. Support follows up on WhatsApp to collect a damage photo, approves a replacement, and sends a shipping confirmation back via email — all tracked in a single dashboard. No Telnyx credentials needed: pip install -r requirements.txt python demo/demo server.py Open http://localhost:5050 http://localhost:5050 and click Run Demo Journey . The dashboard has four panels: | Panel | Content | |---|---| | Customer | Profile card with name, email, phone | | Email Thread | Subject/body cards with inbound blue / outbound green borders | | WhatsApp | Phone-frame UI with chat bubbles, delivery ticks, image thumbnails | | Order & Timeline | Order status badge transitions, damage photo, chronological event log | | Step | Channel | Direction | What Happens | |---|---|---|---| | 1a | | Inbound | Customer reports damaged headphones | | 1b | | Outbound | Auto-acknowledgment, mentions WhatsApp follow-up | | 2 | | Outbound | Template message requesting damage photo | | 3 | | Inbound | Customer sends photo + description | | 4 | | Outbound | Support confirms replacement approved | | 5 | | Outbound | Shipping confirmation with tracking number | Order status transitions: delivered → damage reported → replacement shipping → resolved To run with real Telnyx credentials: cp .env.example .env Edit .env with your credentials python app.py Configure Telnyx webhooks: - Email : https://your-domain.com/webhooks/email - WhatsApp : https://your-domain.com/webhooks/whatsapp email-whatsapp-support-python/ ├── app.py Flask app: webhooks, channel helpers, SSE, customer registry ├── demo/ │ └── demo server.py Imports app.py, mocks APIs, runs scripted journey ├── templates/ │ └── index.html Dashboard UI 4-panel layout ├── requirements.txt flask, python-dotenv, telnyx, requests ├── .env.example Credential placeholders ├── smoke test.py Basic tests ├── README.md This file ├── API.md Endpoint reference └── GUIDE.md Tutorial walkthrough See API.md https://github.com/team-telnyx/telnyx-code-examples/blob/main/email-whatsapp-support-python/API.md for the full endpoint reference. | Endpoint | Method | Description | |---|---|---| | / | GET | Dashboard UI | | /health | GET | Status + mode | | /customers | GET | List customers | | /conversations | GET | Conversation history | | /orders | GET | Order state | | /stream | GET | SSE event stream | | /webhooks/email | POST | Email webhook | | /webhooks/whatsapp | POST | WhatsApp webhook | python smoke test.py