diff --git a/README.md b/README.md index 016068d..5c2fd8a 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,9 @@ This produces `dist/AutoFax.exe` -- a single self-contained file you can copy to ## Sinch Account Setup 1. Sign up at [dashboard.sinch.com](https://dashboard.sinch.com/) -2. Go to **Numbers** and purchase a fax-enabled number -3. Go to **Settings > Access Keys** and create a key pair -4. Note your **Project ID** (shown at the top of the dashboard) -5. Configure: +2. Go to **Settings > Access Keys** and create a key pair +3. Note your **Project ID** (shown at the top of the dashboard) +4. Configure: ```bash cp .env.example .env @@ -60,7 +59,7 @@ This will: - Create a Python virtual environment - Install dependencies - Set up an hourly cron job -- Auto-remove the cron after 7 days +- Stop automatically after 3 successful deliveries ### 3. Manual Test diff --git a/autofax.py b/autofax.py index 402b33e..c016fe1 100755 --- a/autofax.py +++ b/autofax.py @@ -119,20 +119,20 @@ def generate_report(entries: list[dict]): config.REPORTS_DIR.mkdir(parents=True, exist_ok=True) total = len(entries) - success_statuses = {"QUEUED", "IN_PROGRESS", "COMPLETED", "delivered", "sent", "queued", "sending"} + success_statuses = {"QUEUED", "IN_PROGRESS", "COMPLETED"} failed = sum(1 for e in entries if e["status"] not in success_statuses) - succeeded = sum(1 for e in entries if e["status"] in ("COMPLETED", "delivered")) + succeeded = sum(1 for e in entries if e["status"] == "COMPLETED") pending = total - failed - succeeded rows = "" for i, e in enumerate(entries, 1): status = e["status"] - if status in ("COMPLETED", "delivered", "sent"): + if status == "COMPLETED": status_class = "success" - status_display = "DELIVERED" if status == "COMPLETED" else status.upper() - elif status in ("QUEUED", "IN_PROGRESS", "queued", "sending"): + status_display = "DELIVERED" + elif status in ("QUEUED", "IN_PROGRESS"): status_class = "pending" - status_display = status.upper() + status_display = status else: status_class = "failed" status_display = "FAILED" @@ -181,7 +181,7 @@ def generate_report(entries: list[dict]):
This report documents automated fax transmission attempts to the insurance - company for doula coverage claim processing.
+ company for claim processing.Total attempts: {total} | Delivered: {succeeded} | @@ -210,9 +210,8 @@ def generate_report(entries: list[dict]):