๐ฅ Team Assignments
๐พ
Koda
Project Lead
Plan, coordination, approvals
โ Done
โ๏ธ
Nexus
Migration Architect
Technical design, execution
โ Done
๐
Atlas
Documentation
Resend + SE + Harry CRM docs
โ Done
๐ฏ
Catalyst
Customer Advocate
Capability comparison, features
โ Done
๐ Why Resend Over SmartEmailing
| Capability | SmartEmailing | Resend |
|---|---|---|
| API Design | v3 REST, Czech docs, quirky | Modern REST, excellent docs, OpenAPI |
| Authentication | HTTP Basic (user + key) | Bearer token (single key) |
| Transactional Email | Requires SE template ID | Send raw HTML directly |
| Stats Tracking | Polling (hourly) | Webhook-driven (real-time) |
| Inbound Email | โ Not supported | โ Full receiving API |
| MCP Server | โ Not available | โ Official npm package |
| Broadcasts API | Campaigns only | โ Dedicated API |
| Subscription Topics | โ Not available | โ Granular opt-in/out |
| Dynamic Segments | Static contact lists | โ Rule-based segments |
| Email Scheduling | Custom code needed | โ Native scheduling |
| Batch Send | Workaround API | โ Up to 100 per call |
| Domain Mgmt API | โ Manual | โ Full API (create, verify) |
| Contact Properties | Limited custom fields | โ Full properties API |
๐๏ธ Target Architecture
Campaign Engine
Automated flows
โ
resend_client.py
REST API Client
โ
Resend Platform
Shared API key
AI Assistant
Ad-hoc, conversational
โ
Resend MCP Server
npx resend-mcp
โ
Resend Platform
Same API key
Two integration paths: REST client for automated campaigns, MCP server for AI-driven ad-hoc emails. Shared API key, domain, and webhooks.
๐ Files Changed
| Action | File | Description |
|---|---|---|
| CREATE | resend_client.py | Async Resend API client (~400 lines) |
| CREATE | resend_webhooks.py | Webhook parser with svix verification |
| CREATE | schemas/resend.py | Pydantic request/response models |
| CREATE | Alembic migration | New columns + enum values |
| MODIFY | campaign_service.py | _send_via_resend() replaces SE |
| REWRITE | stats_sync_service.py | Poller โ webhook-driven reconciler |
| MODIFY | agent_service.py | Tool descriptions, campaign flow |
| MODIFY | api/webhooks.py | Add Resend webhook route |
| MODIFY | api/integrations.py | Resend auth flow |
| MODIFY | models/*.py | Provider enum, campaign columns |
| MINOR | frontend/settings | Resend integration UI |
| DELETE | smartemailing_client.py | 719 lines removed |
| DELETE | smartemailing_webhooks.py | 168 lines removed |
| DELETE | smartemailing_service.py | ~100 lines (already deprecated) |
| DELETE | schemas/smartemailing.py | 84 lines removed |
๐ Migration Phases
1๏ธโฃ
Foundation
- โข Create resend_client.py
- โข Create schemas/resend.py
- โข Webhook parser with svix
- โข Provider enum + config
- โข MCP Server setup
- โข Unit tests
~600 lines new code
2๏ธโฃ
Campaign Swap
- โข _send_via_resend()
- โข Batch sending (100/call)
- โข Template variable mapping
- โข Fix targeting bug
- โข Broadcast ID tracking
~300 lines modified
3๏ธโฃ
Webhooks & Stats
- โข Resend webhook route
- โข Event mapping (6 types)
- โข Stats โ webhook-driven
- โข Auto-register webhook URL
- โข svix signature verification
~250 lines
4๏ธโฃ
AI Agent Update
- โข Update Slovak tool descriptions
- โข Remove SE-specific fields
- โข Connect MCP for ad-hoc
- โข Full E2E AI flow test
~200 lines modified
5๏ธโฃ
Frontend & Upsell
- โข Resend settings UI
- โข Upsell opportunity toggle
- โข Upsell notes field
- โข Filter by upsell flag
- โข Dashboard widget
~200 lines
6๏ธโฃ
Cleanup & Testing
- โข Delete 4 SE files
- โข DB migration script
- โข Unit + integration tests
- โข E2E AI campaign test
- โข SE reference grep
~300 lines tests
๐ง Tech Debt Fixed During Migration
| Issue | Severity | Fix |
|---|---|---|
hmac.new() bug in webhook handler | ๐ด High | Replaced by svix verification |
| API key "encryption" is just base64 | ๐ก Medium | Use env-only or proper encryption |
/docs endpoint open in production | ๐ก Medium | Disable in prod config |
Debug print() in SE client | ๐ข Low | Removed with SE client deletion |
_get_targeted_customers() sends to ALL | ๐ด High | Fix targeting logic in Phase 2 |
โ Decisions for Caly
| # | Question | Recommendation |
|---|---|---|
| 1 | Which domain to verify in Resend? | Client domain (prod) + lmp-ai.net (dev) |
| 2 | Contact sync strategy | Harry DB = source of truth (no sync) |
| 3 | Transition approach | Hard cut (no dual-provider) |
| 4 | Bulk send method | Batch Send (Harry controls targeting) |
| 5 | API key storage | .env only (simpler, more secure) |
| 6 | Upsell marking design | Boolean flag + notes text field |
| 7 | Parallel period | None (hard cut after testing) |
โ ๏ธ Risk Assessment
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Rate limits during bulk sends | Medium | Campaign delays | Batch with exponential backoff |
| Webhook delivery gaps | Low | Missed stats | svix retry + manual sync fallback |
| Template variable mismatch | Low | Broken emails | Test with real campaign data |
| Agent prompt drift | Medium | Wrong tool calls | Careful Slovak rewrite + testing |
| Domain verification delays | Low | Can't send | Start immediately, use test domain |
๐ Estimated Timeline
Phase 1-2
Sessions 1-3
โ
Phase 3-4
Sessions 3-4
โ
Phase 5-6
Sessions 5-6
โ
Go Live
After Approval
Total: ~6 sessions (can be parallelized to 3-4). No code changes until Caly approves.
๐ Documentation Index
๐
intro/4 files๐
emails/12 files๐
contacts/6 files๐
domains/7 files๐
api-keys/3 files๐
webhooks/4 files๐
broadcasts/6 files๐
templates/5 files๐
audiences/4 files๐
segments/Atlas๐
topics/Atlas๐
dashboard/Atlas๐
mcp-server.mdMCP Guide๐
openclaw-guide.mdAgent Inbox๐
MIGRATION-PLAN.mdKoda