{"slug": "ai-support-agent-that-carries-context-between-email-and-whatsapp-python", "title": "AI Support Agent That Carries Context Between Email and WhatsApp (Python)", "summary": "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.", "body_md": "A unified dashboard demo showing customer support across Email and WhatsApp channels using [Telnyx](https://telnyx.com) APIs.\n\n**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.\n\nNo Telnyx credentials needed:\n\n```\npip install -r requirements.txt\npython demo/demo_server.py\n```\n\nOpen [http://localhost:5050](http://localhost:5050) and click **Run Demo Journey**.\n\nThe dashboard has four panels:\n\n| Panel | Content | \n|---|---|\n| **Customer** | Profile card with name, email, phone | \n| **Email Thread** | Subject/body cards with inbound (blue) / outbound (green) borders | \n| **WhatsApp** | Phone-frame UI with chat bubbles, delivery ticks, image thumbnails | \n| **Order & Timeline** | Order status badge transitions, damage photo, chronological event log | \n\n| Step | Channel | Direction | What Happens | \n|---|---|---|---|\n| 1a |  | Inbound | Customer reports damaged headphones | \n| 1b |  | Outbound | Auto-acknowledgment, mentions WhatsApp follow-up | \n| 2 |  | Outbound | Template message requesting damage photo | \n| 3 |  | Inbound | Customer sends photo + description | \n| 4 |  | Outbound | Support confirms replacement approved | \n| 5 |  | Outbound | Shipping confirmation with tracking number | \n\nOrder status transitions: `delivered` → `damage_reported` → `replacement_shipping` → `resolved`\n\nTo run with real Telnyx credentials:\n\n```\ncp .env.example .env\n# Edit .env with your credentials\npython app.py\n```\n\nConfigure Telnyx webhooks:\n\n- **Email** :`https://your-domain.com/webhooks/email`\n- **WhatsApp** :`https://your-domain.com/webhooks/whatsapp`\n\n```\nemail-whatsapp-support-python/\n├── app.py                  # Flask app: webhooks, channel helpers, SSE, customer registry\n├── demo/\n│   └── demo_server.py      # Imports app.py, mocks APIs, runs scripted journey\n├── templates/\n│   └── index.html          # Dashboard UI (4-panel layout)\n├── requirements.txt        # flask, python-dotenv, telnyx, requests\n├── .env.example            # Credential placeholders\n├── smoke_test.py           # Basic tests\n├── README.md               # This file\n├── API.md                  # Endpoint reference\n└── GUIDE.md                # Tutorial walkthrough\n```\n\nSee [API.md](https://github.com/team-telnyx/telnyx-code-examples/blob/main/email-whatsapp-support-python/API.md) for the full endpoint reference.\n\n| Endpoint | Method | Description | \n|---|---|---|\n| `/` | GET | Dashboard UI | \n| `/health` | GET | Status + mode | \n| `/customers` | GET | List customers | \n| `/conversations` | GET | Conversation history | \n| `/orders` | GET | Order state | \n| `/stream` | GET | SSE event stream | \n| `/webhooks/email` | POST | Email webhook | \n| `/webhooks/whatsapp` | POST | WhatsApp webhook | \n\n```\npython smoke_test.py\n```\n\n", "url": "https://wpnews.pro/news/ai-support-agent-that-carries-context-between-email-and-whatsapp-python", "canonical_source": "https://github.com/team-telnyx/telnyx-code-examples/tree/main/email-whatsapp-support-python", "published_at": "2026-10-16 14:09:18+00:00", "updated_at": "2026-10-16 14:15:03.627501+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-products"], "entities": ["Telnyx", "WhatsApp", "Flask", "Python", "email-whatsapp-support-python"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/ai-support-agent-that-carries-context-between-email-and-whatsapp-python", "markdown": "https://wpnews.pro/news/ai-support-agent-that-carries-context-between-email-and-whatsapp-python.md", "text": "https://wpnews.pro/news/ai-support-agent-that-carries-context-between-email-and-whatsapp-python.txt", "jsonld": "https://wpnews.pro/news/ai-support-agent-that-carries-context-between-email-and-whatsapp-python.jsonld"}}