💬 Conversations & Support Processing
📖 Overview
The Conversations module handles support ticket management, message status tracking, snoozing functionality, and communication health monitoring.
Environment Flags:
QM_SUPPORT_SNOOZE=true- Support ticket snoozingQM_SUPPORT_MESSAGE_STATUS=true- Message status trackingQM_SUPPORT_NOTIFICATION=true- Support notificationsQM_SUPPORT_COMMUNICATION_CHECK=true- Communication validation
Source Location: queue-manager/crons/conversations/
Processing Pattern: Frequent polling (every 30 seconds to 5 minutes)
🗄️ Collections Used
conversation-conversation
- Operations: Read/Write
- Model:
shared/models/conversation-conversation.js - Usage: Support conversation threads
conversation-message
- Operations: Read/Write
- Model:
shared/models/conversation-message.js - Usage: Individual messages and status
conversation-room
- Operations: Read/Write
- Model:
shared/models/conversation-room.js - Usage: Support room management
🔄 Processing Flow
graph TB
SNOOZE[Snooze Cron<br/>Every 5min] -->|Query| CONV[(Conversations)]
MSG_STATUS[Message Status<br/>Every 30s] -->|Query| MSG[(Messages)]
NOTIF[Notifications<br/>Every 1min] -->|Query| CONV
COMM_CHECK[Comm Check<br/>Every 10min] -->|Validate| CHANNELS[(Channels)]
SNOOZE -->|Unsnooze| CONV
MSG_STATUS -->|Update Status| MSG
NOTIF -->|Send| EMAIL[Email Service]
COMM_CHECK -->|Flag Issues| ALERTS[(Alerts)]
🔧 Jobs in This Module
Core Jobs
- 📘 Support Snooze - Unsnooze support tickets at scheduled time
- 📗 Message Status - Track and update message delivery status
- 📙 Notifications - Send support ticket notifications
- 📕 Communication Check - Validate communication channels
⚙️ Configuration
Required Environment Variables:
QM_SUPPORT_SNOOZE=true
QM_SUPPORT_MESSAGE_STATUS=true
QM_SUPPORT_NOTIFICATION=true
QM_SUPPORT_COMMUNICATION_CHECK=true
MONGO_DB_URL=...
REDIS_HOST=localhost
REDIS_PORT=6379
📘 Support Snooze
Overview
Automatically unsnoozes support tickets when their snooze period expires.
Cron Schedule: */5 * * * * (Every 5 minutes)
Key Features:
- Scheduled Unsnoozing: Activates snoozed tickets at specified time
- Priority Restoration: Restores original ticket priority
- Agent Notification: Notifies assigned agents
- Queue Reinsertion: Adds back to active support queue
📗 Message Status Tracking
Overview
Tracks message delivery and read status across communication channels.
Cron Schedule: */30 * * * * * (Every 30 seconds)
Key Features:
- Delivery Tracking: Monitors message delivery (sent, delivered, failed)
- Read Receipts: Tracks when messages are read
- Failed Message Retry: Retries failed message deliveries
- Status Webhooks: Processes status updates from Twilio, SendGrid
📙 Support Notifications
Overview
Sends notification emails for support ticket activities.
Cron Schedule: */1 * * * * (Every 1 minute)
Key Features:
- New Ticket Alerts: Notifies agents of new tickets
- Assignment Notifications: Alerts on ticket assignment
- Response Reminders: Reminds agents of pending responses
- Escalation Alerts: Notifies managers of escalated tickets
- Customer Updates: Sends status updates to customers
Notification Types:
- New ticket created
- Ticket assigned to agent
- New message from customer
- Ticket status changed
- SLA breach warning
- Ticket resolved/closed
📕 Communication Health Check
Overview
Validates communication channel health and configuration.
Cron Schedule: */10 * * * * (Every 10 minutes)
Key Features:
- Channel Validation: Verifies SMS, email channels are active
- API Health: Checks Twilio, SendGrid API connectivity
- Number Status: Validates phone number configurations
- Error Detection: Identifies misconfigured channels
- Alert Generation: Creates alerts for communication issues
Health Checks:
- Twilio account balance and status
- SendGrid API key validity
- Phone number active status
- Email domain verification
- Webhook endpoint availability
🔗 Related Documentation
- Queue Manager Overview
- Architecture (documentation unavailable)
- Configuration
Module Status: Active
Execution Pattern: Frequent polling
Last Updated: 2025-10-10