All changes made locally. Ready to test and deploy.
- 5 GA4-driven templates automatically personalize based on lead behavior
- Templates: HOT, WARM, ENGAGED, ABANDONED, FINAL
- Integrated into both master template editor and individual dropdown
- Admin page now correctly filters by
lead_status(GA4) ANDoutreach_status(manual CRM) - Daily GA4 script updates will populate lead filters
- 11 total templates now available in
/admin/outreach/templates - Preview, copy, and test send for all variants
- 11 templates in
/admin/businessesper-business email composer - Organized in 3 rows: Standard (A-D), Launch (LAUNCH/LAUNCH50), GA4 Behavioral (HOT/WARM/ENGAGED/ABANDONED/FINAL)
✓ src/lib/outreach-templates.ts
- Added behavioral template types
- Integrated behavioral-email-templates.ts
- Added LAUNCH and LAUNCH50 templates
- Updated VARIANT_LABELS
✓ src/app/api/admin/outreach/templates/route.ts
- Added all 11 variants to API
✓ src/app/api/admin/businesses/route.ts
- Fixed lead_status vs outreach_status filtering
- Added GA4 fields to SELECT (lead_status, lead_score, last_engagement, profile_views, etc.)
✓ src/app/admin/outreach/templates/page.tsx
- Added all 11 variants
- Added color coding for behavioral templates
✓ src/app/admin/businesses/page.tsx
- Updated variant type
- Updated VARIANT_LABELS with emojis
- Reorganized template buttons into 3 sections
- A: Verification / Claim
- B: Locals Are Searching
- C: Short & Direct
- D: Featured Opportunity
- LAUNCH: $50/Year Launch
- LAUNCH50: 50% OFF - $24.99/Year
- HOT: 🔥 Clicked claim link + 30+ seconds engagement
- WARM: 💡 Multiple page views, researching
- ENGAGED: ⚡ Clicked phone or website button
- ABANDONED: ⏸️ Clicked claim but bounced in <10 seconds
- FINAL: ⏰ Final urgency after 7 days (multi-touch)
{
lead_status: 'ultra-hot' | 'hot' | 'warm',
lead_score: 0-300+,
last_engagement: timestamp
}- Ultra-Hot (Score 200+) →
lead_status = 'ultra-hot' - Hot (Score 100-199) →
lead_status = 'hot' - Warm (Score 50-99) →
lead_status = 'warm' - Hot Lead (Legacy) →
outreach_status = 'hot_lead' - Interested →
outreach_status = 'interested' - Emailed →
outreach_status = 'emailed' - etc.
if (leadStatus === 'ultra-hot' || 'hot' || 'warm') {
where.lead_status = leadStatus; // GA4 automated
} else {
where.outreach_status = leadStatus; // Manual CRM
}npm run devNavigate to: http://localhost:3000/admin/outreach/templates
Should see:
- 11 template variants in sidebar
- Color-coded chips (blue, green, purple, amber, indigo, pink, red, orange, teal, gray, rose)
- Full HTML preview for each
- Copy HTML and Send Test buttons working
Navigate to: http://localhost:3000/admin/businesses
Should see:
- Lead Status filter with Ultra-Hot/Hot/Warm options
- Click any business to expand
- Template selector with 3 sections:
- Row 1: A, B, C, D
- Row 2: LAUNCH, LAUNCH50
- Row 3: HOT, WARM, ENGAGED, ABANDONED, FINAL
- Preview should load for each variant
-- Manually set a test business to hot
UPDATE local_businesses
SET lead_status = 'hot', lead_score = 150
WHERE id = 'some-business-id';Then filter by "Hot (Score 100-199)" in admin page → Should show that business
# Core library
src/lib/outreach-templates.ts
src/lib/behavioral-email-templates.ts (already exists locally, needs VPS)
# API routes
src/app/api/admin/outreach/templates/route.ts
src/app/api/admin/businesses/route.ts
# Admin pages
src/app/admin/outreach/templates/page.tsx
src/app/admin/businesses/page.tsx# From local machine
cd /c/Users/nashr/max-ev-holdings/dallas-daily
# Copy all changed files to VPS
scp -i ~/.ssh/id_ed25519 src/lib/outreach-templates.ts root@72.60.43.168:/var/www/dfw-daily/src/lib/
scp -i ~/.ssh/id_ed25519 src/lib/behavioral-email-templates.ts root@72.60.43.168:/var/www/dfw-daily/src/lib/
scp -i ~/.ssh/id_ed25519 src/app/api/admin/outreach/templates/route.ts root@72.60.43.168:/var/www/dfw-daily/src/app/api/admin/outreach/templates/
scp -i ~/.ssh/id_ed25519 src/app/api/admin/businesses/route.ts root@72.60.43.168:/var/www/dfw-daily/src/app/api/admin/businesses/
scp -i ~/.ssh/id_ed25519 src/app/admin/outreach/templates/page.tsx root@72.60.43.168:/var/www/dfw-daily/src/app/admin/outreach/templates/
scp -i ~/.ssh/id_ed25519 src/app/admin/businesses/page.tsx root@72.60.43.168:/var/www/dfw-daily/src/app/admin/businesses/
# SSH to VPS and rebuild
ssh -i ~/.ssh/id_ed25519 root@72.60.43.168 "
cd /var/www/dfw-daily
npm run build && pm2 restart dfw-daily --update-env
"
# Check logs
ssh -i ~/.ssh/id_ed25519 root@72.60.43.168 "pm2 logs dfw-daily --lines 50"- Deploy files to VPS
- Test master template editor
- Test individual dropdown
- Verify all 11 templates load
- Deploy GA4 processing scripts (separate task)
- Set up daily cron job
- Upload first GA4 CSV
- Process leads
- Filter by "Ultra-Hot" in admin
- See fresh GA4-scored leads
- Select behavioral template (HOT/WARM/ENGAGED)
- Send first behavioral emails
- Track responses
- 11 templates with full previews
- Test sends work for all variants
- Behavioral templates show personalized content
- Quick template selection per business
- GA4 behavioral templates available
- Templates load instantly on variant change
- GA4 daily script populates lead_status
- Ultra-Hot/Hot/Warm leads appear in filters
- Manual CRM statuses (emailed, called, etc.) continue working
- Both systems work together seamlessly
After 1 week:
- ✓ All 11 templates accessible in both systems
- ✓ GA4 leads populating daily in filters
- ✓ Behavioral emails sending successfully
- ✓ Response rate tracking in admin dashboard
Target conversion rates:
- Hot leads: 20-30% conversion
- Warm leads: 5-10% conversion
- Engaged leads: 15-25% conversion
Integration Complete! Test locally, then deploy to VPS.