The RulesEngine has a sendWhatsApp action, but there’s no actual dispatch. We need to integrate Twilio WhatsApp API so urgent emails reach users’ phones.
Acceptance Criteria
• Create backend/src/services/outputs/whatsapp.adapter.ts
• Implement sendNotification(userId, emailSummary) using Twilio SDK
• Support Twilio WhatsApp API (primary) and WhatsApp Business API (secondary)
• Format: “ [Category] from [Sender][AI Summary]Required: [Yes/No]”
• Handle Twilio rate limits (1 msg/sec sandbox)
• Exponential backoff retry via BullMQ
• Track delivery status in Notification model
• Add WhatsApp credentials to Integration model (encrypted)
• Add WhatsApp connection flow to frontend Settings
Technical Notes
• Check DND settings before sending
• Message must be under 1600 characters
• Validate phone numbers (E.164 format)
• Support “STOP” reply to pause notifications
The RulesEngine has a sendWhatsApp action, but there’s no actual dispatch. We need to integrate Twilio WhatsApp API so urgent emails reach users’ phones.
Acceptance Criteria
• Create backend/src/services/outputs/whatsapp.adapter.ts
• Implement sendNotification(userId, emailSummary) using Twilio SDK
• Support Twilio WhatsApp API (primary) and WhatsApp Business API (secondary)
• Format: “ [Category] from [Sender][AI Summary]Required: [Yes/No]”
• Handle Twilio rate limits (1 msg/sec sandbox)
• Exponential backoff retry via BullMQ
• Track delivery status in Notification model
• Add WhatsApp credentials to Integration model (encrypted)
• Add WhatsApp connection flow to frontend Settings
Technical Notes
• Check DND settings before sending
• Message must be under 1600 characters
• Validate phone numbers (E.164 format)
• Support “STOP” reply to pause notifications