ferrero-opentext/Python-Version/scripts
DJP c720759cc7 Add daily summary report with comprehensive statistics
Automated daily report that analyzes all workflow logs and sends email summary at 7pm.

NEW SCRIPT: daily_report.py
- Analyzes last 24 hours of all workflow logs
- Parses campaign and asset statistics
- Extracts error messages
- Sends comprehensive email report
- Run via cron at 7pm daily

FEATURES:
✓ Overall summary statistics across all workflows
✓ Per-workflow breakdown (A1→A2, A2→A3, A5→A6, B1→B2)
✓ Success rate calculation
✓ Campaign details with status (completed/partial/no_assets)
✓ Error log extraction
✓ Collapsible sections for campaign and error details
✓ Color-coded metrics (green=good, orange=warning, red=error)

STATISTICS TRACKED:
- Campaigns found/processed/completed/partial
- Total assets processed/successful/failed
- NOT APPROVED assets (A5→A6)
- Skipped assets (approved items)
- Success rate percentage
- Error count and messages

EMAIL TEMPLATE: daily_report
- Blue theme (#1976d2)
- Grid layout for statistics
- Collapsible campaign details
- Collapsible error logs (max 10 shown)
- Professional dashboard-style formatting

USAGE:
  python scripts/daily_report.py

CRON SCHEDULE (7pm daily):
  0 19 * * * cd ~/Python-Version && venv/bin/python scripts/daily_report.py >> logs/daily_report.log 2>&1

TESTED:
✓ Successfully parsed all 4 workflow logs
✓ Found 26 campaigns, 58 assets from last 24 hours
✓ Email sent successfully with all statistics
✓ Success rate: 48.3% (from test data)
✓ Error extraction working

Changes:
- NEW: scripts/daily_report.py (241 lines)
- EDIT: shared/notifier.py (add daily_report template)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 16:34:44 -05:00
..
shared Add daily summary report with comprehensive statistics 2025-11-04 16:34:44 -05:00
a1_to_a2_download.py Add 'no assets found' email notifications for A1→A2 and B1→B2 2025-11-04 15:33:25 -05:00
a2_to_a3_upload.py Complete Python automation implementation - All components built 2025-10-30 16:49:14 -04:00
a2_to_a3_upload_polling.py Add Box metadata extraction for CreativeX fields in A2→A3 workflow 2025-11-03 14:26:00 -05:00
a5_to_a6_download.py Fix A5→A6 Final Assets search and unify email template styling 2025-11-04 15:25:30 -05:00
b1_to_b2_download.py Add 'no assets found' email notifications for A1→A2 and B1→B2 2025-11-04 15:33:25 -05:00
daily_report.py Add daily summary report with comprehensive statistics 2025-11-04 16:34:44 -05:00
test_connection.py Complete Python automation implementation - All components built 2025-10-30 16:49:14 -04:00