graph TD
A[Hyper_Personalization_Agent Start] --> B[Load qualified_leads.csv]
B --> C{Process Each Lead}
C --> D[SILO 1: Tour Match]
C --> E[SILO 2: Weather]
C --> F[SILO 3: Email]
C --> G[SILO 4: Send & Track]
D --> D1[Map Interest to ProductCode]
D1 --> D2[Check Rezdy Availability]
D2 --> D3[Generate Booking URL]
E --> E1[Fetch Weather Forecast]
E1 --> E2[Format Weather JSON]
F --> F1[Generate Email Content]
F2[Weather Data] --> F1
D3 --> F1
F1 --> F3[Build HTML Template]
G --> G1[Send via SMTP]
F3 --> G1
G1 --> G2[Log to email_log.csv]
G2 --> H{Monitor Webhooks}
H --> I[Open Event]
H --> J[Click Event]
I --> K[Update Log: Opened]
J --> L[Update Log: Clicked]
K --> M[Continue Monitor]
L --> M
M --> N[End Lead Process]
N --> C
style A fill:#f9f,stroke:#333
style C fill:#bbf,stroke:#333
style D fill:#dfd,stroke:#333
style E fill:#dfd,stroke:#333
style F fill:#dfd,stroke:#333
style G fill:#dfd,stroke:#333