Automation

TMS notifications in Telegram — events, digests, 2FA

📅2026
2 weeks
👥1 developer
TTMS Notify Botbot📦Load #15214 deliveredDallas, TX · POD attached08:00💵Invoice #8841 paid$2,450 · ACME Brokers08:01🌅Morning digest4 pickups · 6 deliveries · 3 ready to bill08:02🏭CARRIER OUT · 12 palletsBOL.pdf attached08:03🔐Login code: 483-291Trusted device · 5 daysMy notificationsLinked · @alexLoad createdLoad deliveredReady to billInvoice paidMorning digestBilling digestDelivery pipelineEventload deliveredRoutercatalog checkPrefswho subscribedTelegrampersonal DMcron 08:00 → digest (idempotent) · fallback: GitHub Actions ✓
11
event types in the catalog
3
roles with their own sets
5
trusted-device days (2FA)

The challenge

The TMS team learned about events — a load ready to bill, an invoice paid, a warehouse arrival — from chats or by accident. A shared Telegram channel spammed everyone with everything. They needed personal notifications: everyone picks what they receive, routine summaries arrive as digests, and the warehouse sees its events in its own group.

What was built

A notification hub was built around Telegram: an event catalog in code, per-user subscriptions, real-time delivery and cron digests. The same channel was reused for two-factor login.

1

An event catalog with role-based subscriptions

admin, billing and dispatcher each see their own set of toggles; adding an event = one catalog entry plus one router call.

2

Account-to-Telegram linking via a one-time code

everyone gets messages personally, no shared chat.

3

Real-time events: load created / delivered / ready to bill, invoice paid

instantly, with details and a link.

4

Morning digests: the admin’s picture of the day (pickups, deliveries, ready to bill) and a billing digest; the endpoint is idempotent

no duplicates even if the cron fires twice.

5

Warehouse bots: CARRIER OUT summaries with BOL documents as PDFs, CARRIER IN alerts and a morning post about today’s arrivals

all into the warehouse group.

6

Telegram 2FA at login: a code in a direct message + trusted devices for 5 days.

7

Resilient cron infrastructure: primary runs on the hosting, GitHub Actions as a fallback

delivery doesn’t depend on a single scheduler.

The result

Everyone on the team gets only their own events, the morning digest replaced manual board checks, and the warehouse lives in one Telegram group where summaries with BOL documents arrive on their own. Two-factor login was closed with the same bot — no paid service required.

Tech stack

PHP (Yii2)Telegram Bot APIMySQLGitHub Actions

Have a similar challenge?

Discuss a project

Next case

Industry CRM

Print shop CRM — from order to signed act