Telegram Support Handler
ACTIONSends draft response previews to admin via Telegram with Accept/Edit/Reject inline buttons. Handles callback queries from Telegram. Stores pending responses persistently in a JSON file. Removes inline keyboard buttons after callback click to prevent double-clicks. Notifies Events pipeline on callback via internal chat API.
Endpoints
· 5POST/handle-callbackHandles an admin callback decision (accept/edit/reject) for a pending draft, answers the Telegram callback query, and notifies the Events pipeline
Input Schema
{
"type": "object",
"properties": {
"action": {
"type": "string",
"description": "Decision action: accept, edit, or reject"
},
"chatId": {
"type": "string",
"description": "Telegram chat ID"
},
"emailId": {
"type": "string",
"description": "UUID of the email"
},
"required": [
"action",
"emailId"
],
"messageId": {
"type": "number",
"description": "Telegram message ID"
},
"callbackQueryId": {
"type": "string",
"description": "Telegram callback query ID to dismiss loading"
}
}
}GET/pending-response/:emailIdRetrieves the pending draft response for a given emailId from the in-memory store
GET/Dashboard UI showing email history summary cards and a detailed table of all processed emails
GET/email/:emailIdDetail page for a single email history entry, shows all metadata, original email body, and draft response
POST/send-draftSends a draft support email response to the admin via Telegram, optionally with inline accept/edit/reject buttons
Input Schema
{
"type": "object",
"required": [
"emailFrom",
"emailSubject",
"draftResponse",
"emailId"
],
"properties": {
"chatId": {
"type": "string",
"description": "Optional Telegram chat ID, falls back to ADMIN_CHAT_ID env var"
},
"aiNotes": {
"type": "string",
"description": "Optional notes from the AI — extra context or info the AI wants the admin to know when reviewing the draft"
},
"emailId": {
"type": "string",
"description": "UUID of the original email"
},
"emailBody": {
"type": "string",
"description": "Original customer email body text"
},
"emailFrom": {
"type": "string",
"description": "Sender email address"
},
"emailSubject": {
"type": "string",
"description": "Email subject line"
},
"draftResponse": {
"type": "string",
"description": "The drafted response text"
},
"includeButtons": {
"type": "boolean",
"description": "Whether to include inline Accept/Edit/Reject buttons (defaults to true)"
}
}
}Required Secrets
· 4Similar ACTION Pieces
Shared Terminal
Full-featured web terminal with Node.js, Python, Deno, git, and build tools — running in a Podman container with Ubuntu 24.04
Coolify Logs Watcher
Polls Coolify API for application logs, stores in SQLite, exposes search endpoints for support email triage. Monitors free-copier-py, free-copier-express, and free-copier-next runtime logs. Used by the Events pipeline (Sydney) to find relevant errors when drafting support responses.
Coverter
Converts HTML content to PDF using headless Chromium (Puppeteer). Accepts raw HTML or a URL, returns a downloadable PDF.