Claude
|
066ce32aa7
|
feat(dealix): full automation outreach system — draft queue + pipeline + send
Complete outreach automation that generates drafts → Sami approves → system sends:
1. OutreachDraft model (models/outreach_draft.py):
DB-persisted draft queue. Every message starts as status='draft'.
Fields: company, channel, subject, body, followups, sector, scores,
status (draft→approved→sent→replied→opted_out→bounced), timestamps.
2. Daily Pipeline (automation.py → /daily-pipeline/run):
Generates N targets per sector/city, runs compliance check,
creates personalized emails with Arabic pain maps, stores as
draft rows in DB. Returns batch_id for approval.
3. Draft Queue API (drafts.py):
- GET /drafts — list by status/channel/batch
- GET /drafts/stats — counts per status
- GET /drafts/{id} — full draft with body + followups
- POST /drafts/{id}/approve — mark approved
- POST /drafts/approve-batch — approve entire batch
- POST /drafts/{id}/send — dispatch via email/whatsapp/sms
- POST /drafts/{id}/skip — archive draft
- PATCH /drafts/{id} — edit before approving
- POST /drafts/{id}/log-reply — paste reply → auto-classify →
generate suggested response → update status
4. Send dispatch uses existing integrations:
- Email: integrations/email_sender.py (SMTP)
- WhatsApp: integrations/whatsapp.py (Business API + mock)
- SMS: integrations/sms.py (Unifonic)
- LinkedIn: manual_required (copy from dashboard)
Safety:
- All drafts require approval (approval_required=True default)
- Unsubscribe reply → immediate opt_out status
- Compliance gate blocks: opt_out, bounced, high_risk, no_source
- Personal email → warning to use manual channel
- Rate limits enforced at send level
https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
|
2026-04-25 17:33:30 +00:00 |
|