Notification System Agent
Centralized outbound notification management for all channels (WhatsApp, Telegram, email).
Architecture
notification-system/
โโโ SKILL.md # This file
โโโ templates/ # Message templates by channel & type
โ โโโ whatsapp/ # WhatsApp templates
โ โโโ telegram/ # Telegram templates
โ โโโ email/ # Email templates
โโโ queue/ # Pending notification queue
โโโ logs/ # Delivery logs
โโโ rate-limiters.json # Rate limit configuration
โโโ config/ # Channel configs
Supported Channels
| Channel | Config | Rate Limits |
|---|
| WhatsApp | channels.whatsapp | 60 msg/min, 1000/day |
| Telegram | channels.telegram | 30 msg/sec, 20 msg/min |
| Email (Outlook) | office365-connector | 30 msg/hour, 300/day |
Rate Limiting
Default limits per channel:
- WhatsApp: 1 message/second (safety), burst of 5
- Telegram: 30 messages/second hard limit from API
- Email: 60 emails/hour to prevent spam flags
Rate limit config: notification-system/rate-limiters.json
Template Variables
All templates support:
{{recipient}} - Target name/ID
{{date}} - Current date
{{time}} - Current time
{{subject}} - Message subject
{{body}} - Message body
{{cta_url}} - Call-to-action link
{{sender_name}} - Business/sender name
{{company}} - Company name
Sending a Notification
WhatsApp
# Via message tool
message send --channel whatsapp --target "+18184389562" --message "Your appointment is confirmed for {{date}}"
Telegram
# Via message tool
message send --channel telegram --target "655641853" --message "System alert: {{subject}}"
Email
# Via outlook skill
outlook send --to "recipient@email.com" --subject "{{subject}}" --body "{{body}}"
Queue System
Notifications are queued in notification-system/queue/pending.json:
{
"id": "uuid",
"channel": "whatsapp|telegram|email",
"target": "recipient-id",
"template": "template-name",
"variables": {},
"scheduled_at": "ISO8601 or null",
"created_at": "ISO8601",
"priority": "high|normal|low",
"status": "pending|sent|failed|delivered",
"attempts": 0,
"last_error": null
}
Scheduling
Scheduled notifications stored in notification-system/queue/scheduled.json with cron-like scheduling.
Use cron jobs with notification-system/process-queue.js to process scheduled items.
Delivery Tracking
Logs stored in notification-system/logs/delivery-YYYY-MM-DD.json:
{
"id": "notification-uuid",
"timestamp": "ISO8601",
"channel": "whatsapp",
"target": "+1...",
"template": "appointment-confirm",
"status": "delivered|sent|failed",
"latency_ms": 450,
"error": null
}
Template Management
Templates stored in notification-system/templates/{channel}/{type}.md:
templates/
โโโ whatsapp/
โ โโโ appointment-confirm.md
โ โโโ appointment-reminder.md
โ โโโ payment-received.md
โ โโโ status-update.md
โ โโโ broadcast-promotion.md
โ โโโ support-acknowledged.md
โโโ telegram/
โ โโโ system-alert.md
โ โโโ status-report.md
โ โโโ daily-brief.md
โ โโโ broadcast.md
โโโ email/
โโโ invoice.md
โโโ welcome.md
โโโ notification.md
Process Queue
To process pending notifications:
node notification-system/process-queue.js
Status Commands
- List pending:
Get-Content queue/pending.json | ConvertFrom-Json
- Check rate limits:
Get-Content rate-limiters.json
- View recent logs:
Get-Content logs/delivery-$(Get-Date -Format 'yyyy-MM-dd').json
Best Practices
- Batch wisely: Group similar notifications, respect quiet hours
- Fallback channels: If WhatsApp fails, try Telegram, then email
- Deduplicate: Don't send same notification twice within 24h
- Opt-out handling: Honor STOP/opt-out requests immediately
- Personalize: Use recipient name and relevant variables
- Monitor delivery: Check logs for failures and retry
Priority Handling
high: System alerts, urgent items โ Skip rate limit queue
normal: Standard notifications โ Normal rate limiting
low: Marketing, non-urgent โ Strictest rate limiting