BetterFiles Dispo Email Manager
You are helping a TC (Transaction Coordinator) manage disposition emails for real estate deals. The system has 25 email templates that cover the full deal lifecycle from offer to close.
Two Modes
CLI Mode (default in Claude Code)
Use this when the user wants to quickly check status or send a single email.
Steps:
- Identify the deal — ask for deal name/address/ID if not provided
- Run intake check:
node /home/opsadmin/.openclaw/workspace/scripts/dispo-intake-checker.js <dealId> - Show readiness summary for all 25 email types
- When user picks an email type, render preview:
node /home/opsadmin/.openclaw/workspace/scripts/dispo-email-sender.js <dealId> <emailType> --dry-run - Show the rendered subject, recipient, and ask for confirmation
- Send:
node /home/opsadmin/.openclaw/workspace/scripts/dispo-email-sender.js <dealId> <emailType>
Web UI Mode
Use this when the user wants the full visual experience, needs to upload documents, or manage multiple emails.
Launch:
- Check if server is running:
curl -s http://127.0.0.1:18798/api/health - If not running:
systemctl --user start dispo-email-ui - Provide URL:
http://localhost:18798(local) orhttps://srv1347501.tailb025a7.ts.net/dispo-emails(external) - If user provides a deal ID, append:
?dealId=<id>
25 Email Types
| # | Key | Name | Sender |
|---|---|---|---|
| 1 | open_escrow | 🎉 Open Escrow | teamsteph |
| 2 | make_offer | 📩 Make Offer | angel |
| 3 | assignment_docs | 🏚️ Assignment & Supporting Docs | angel |
| 4 | wire_instructions | 🏦 Wire Instructions | teamsteph |
| 5 | buyer_lender_intro | 👤 Buyer/Lender Intro | teamsteph |
| 6 | sign_original_contract | ✍️ Sign Original Contract | angel |
| 7 | assignment_breakdown | 🏡 Assignment Breakdown & Details | teamsteph |
| 8 | jv_agreement | 🤝 Joint Venture Agreement | teamsteph |
| 9 | insurance_quote | 🔍 Insurance Quote | teamsteph |
| 10 | pre_release_emd | 💰 Pre-Release of EMD | teamsteph |
| 11 | payout_addendum | 📄 Payout Addendum | teamsteph |
| 12 | buyer_notary | 📝 Buyer Notary Appointment | teamsteph |
| 13 | seller_notary | 📝 Seller Notary Appointment | teamsteph |
| 14 | buyer_settlement_review | 📊 Buyer Settlement Statement Review | teamsteph |
| 15 | file_status_to_fund | 📋 File Status to Fund | teamsteph |
| 16 | disbursement_invoice | 💸 Disbursement Instructions & Invoice | teamsteph |
| 17 | third_party_refund | 🔄 Third Party Deposit Refund | teamsteph |
| 18 | settlement_final_wire | 📊 Settlement Statement & Final Wire | teamsteph |
| 19 | ex_invoice | 🧾 Invoice (EX Close) | teamsteph |
| 20 | lender_communication | 🏦 Lender Communication | teamsteph |
| 21 | title_orders | 📜 Title Orders / Report | teamsteph |
| 22 | tc_invoice | 🧾 TC Invoice | teamsteph |
| 23 | hud_status_update | 📣 HUD / Status Update | teamsteph |
| 24 | extension_request | ⏳ Extension Request | teamsteph |
| 25 | hoa_docs_request | 🏘️ HOA Docs Request | teamsteph |
Key Files
- Templates:
/home/opsadmin/.openclaw/workspace/scripts/dispo-templates/*.js - Sender:
/home/opsadmin/.openclaw/workspace/scripts/dispo-email-sender.js - Intake checker:
/home/opsadmin/.openclaw/workspace/scripts/dispo-intake-checker.js - API server:
/home/opsadmin/.openclaw/workspace/scripts/dispo-email-ui-server.js - PDF extractor:
/home/opsadmin/.openclaw/workspace/scripts/lib/pdf-field-extractor.js - Gmail tokens:
/home/opsadmin/.openclaw/workspace-betterfiles/gmail-tokens.json - Build spec:
/home/opsadmin/.openclaw/workspace/knowledge-base/betterfiles/DISPO-EMAIL-BUILD-SPEC.md
Document Upload (CLI)
When a user uploads a PDF (wire instructions, contract, etc.):
- Save to
/home/opsadmin/.openclaw/workspace/data/dispo-documents/<dealId>/ - Parse with:
require('./scripts/lib/pdf-field-extractor').extractFields(buffer, filename) - Show extracted fields for confirmation
- Apply confirmed fields to HubSpot deal
Template Variants
Each email type can have multiple HTML design variants stored in Supabase dispo_template_variants table. The active variant is used for production sends. TCs can compare variants side-by-side in the web UI.
Gmail Accounts
teamsteph@betterfiles.com— most emails (tokens at workspace-betterfiles/gmail-tokens.json)angel@reri.co— emails 2, 3, 6 (make offer, assignment docs, sign contract)