📧
Outlook / Graph API
Not configured
📍
Auto-Demographics
✓ Census API + Google Maps ready
🔔
Daily Digest
✓ Sends to OWNER_EMAIL set

Environment Variables — /Users/dan/Desktop/retailmatch/.env

GRAPH_TENANT_ID Your Azure tenant ID (Directory ID) from portal.azure.com Missing
GRAPH_CLIENT_ID App Registration → Application (client) ID Missing
GRAPH_CLIENT_SECRET App Registration → Certificates & Secrets → client secret value Missing
SMTP_EMAIL Your Outlook email address (e.g. dan@dpegfund.com) Set ✓
GOOGLE_MAPS_KEY Google Cloud → Geocoding API + Places API (New) key Set ✓
CENSUS_API_KEY Free key from api.census.gov/data/key_signup.html — required for auto-demographics Missing
HUNTER_API_KEY Free key from hunter.io — auto-finds real estate contacts by domain (25 lookups/month free, 500/mo on $49 plan) Missing
APOLLO_API_KEY Free key from apollo.io — people search by company + title, 600 credits/month free Missing
OWNER_EMAIL Where to send daily digest (your personal email) Set ✓
OWNER_PHONE Your phone number — appears in email signature Missing
SMTP_PASSWORD Your Outlook password (fallback if Graph not configured) Set ✓

🔑 Microsoft Graph API Setup — 5 Minutes

This connects RetailMatch directly to your Outlook mailbox. Every email sent will appear in your Sent folder. Every reply will be auto-detected and the deal stage will be updated automatically.

1
Open Azure Portal
Go to portal.azure.com and sign in with the Microsoft 365 account you use for Outlook (e.g. dan@dpegfund.com).
2
Register a New App
Azure Active Directory → App RegistrationsNew Registration
Name: RetailMatch
Supported account types: Accounts in this organizational directory only (Single tenant)
Click Register
3
Copy IDs → .env
On the app Overview page, copy:
Application (client) IDGRAPH_CLIENT_ID
Directory (tenant) IDGRAPH_TENANT_ID
4
Create a Client Secret
Left menu → Certificates & SecretsNew client secret
Description: RetailMatch · Expiry: 24 months
Copy the Value immediately (it disappears after you leave) → GRAPH_CLIENT_SECRET
5
Grant Mailbox Permissions
Left menu → API PermissionsAdd a permission → Microsoft Graph → Application permissions
Search and add:
  • Mail.Send
  • Mail.ReadWrite
Then click "Grant admin consent for [your org]" (requires global admin)
6
Set SMTP_EMAIL in .env
This is the Outlook address emails are sent FROM and the inbox monitored for replies.
Example: SMTP_EMAIL=dan@dpegfund.com
7
Restart RetailMatch & Test
Restart the server (python3 app.py in terminal), then click Test below.

📊 Auto-Demographics — Census Bureau API

When you upload a rent roll, RetailMatch automatically pulls population, income, and demographic data from the US Census Bureau ACS — free, no CoStar required. This fills in pop_3mi, pop_5mi, and median_hhi for your matching algorithm.

About CoStar: CoStar does not offer a public API — their data is accessible only through their subscription portal or licensed data exports. The Census ACS 5-year data (same underlying government data source) gives comparable accuracy for population and income rings and is updated annually.

Test Demographics Pull

🔄 Reply Monitor — Every 15 Minutes

Once Outlook is connected, RetailMatch polls your inbox every 15 minutes. When a reply to one of your pitch emails comes in, it:

  1. Matches the reply to the CRM prospect using Outlook's conversationId
  2. Classifies the reply: Interested / Responded / Dead
  3. Updates the deal stage automatically
  4. Logs the reply body as an activity in the timeline
  5. Marks the email as read in your inbox

The classifier looks for keywords like "interested", "would like to talk", "schedule" (→ INTERESTED), or "not interested", "not in market", "paused expansion" (→ DEAD with reason auto-filled). Neutral replies move to RESPONDED for your review.