Tuesday, May 5, 2026

Fix silent email send failures

Volleyball Elite Academy development update
Volleyball Elite Academy
Fix silent email send failures

Fix silent email send failures

Volleyball Elite Academy — Development Update • May 5, 2026

Fix silent email send failures

What & Why

Every outbound email since 2026-04-29 has failed with Resend error — including 7 daily blog auto-posts to Blogger and the most recent Weekly Academy Digest to admins. The system reports all of this as healthy because:

1. The "Resend webhook healthy" banner only watches the inbound event webhook, not the outbound send result. Resend never accepted the messages, so no events ever arrived, so the banner stays green. 2. The blog auto-poster inserts a row and logs before it knows whether Resend accepted the send. The history table looks complete while nothing actually reached Blogger.

This task makes silent send failures impossible to miss and makes the recorded history honest.

Done looks like

  • The Comms Hub dashboard shows an unmistakable red banner whenever the
recent outbound failure rate is high (e.g. ≥50% of the last 10 sends in the last 24h failed), with the most common error message inline ("API key is invalid", "domain not verified", etc.). The existing green "webhook healthy" pill is no longer the only indicator.
  • A daily auth-failure alert: if any send in the last 24h failed with
an authentication-class error (HTTP 401/403, message contains "API key is invalid" / "unauthorized"), an in-app SuperAdmin notification is raised and a single summary email goes to SuperAdmins the next time the scheduler runs. Deduped per day per error class so a broken key doesn't flood the inbox.
  • The blog auto-poster only marks a post as published after Resend
returns a status. If the send fails, the row is not inserted (or is inserted with a flag that hides it from "successfully posted" counts and exposes a Retry button in the Dev Blog Publisher).
  • The Dev Blog Publisher panel surfaces the delivery status of recent
posts (sent / failed + error) and the last successful send timestamp, not just "we wrote a row".
  • A small backfill/utility action (button in Dev Blog Publisher, or a
one-shot admin endpoint) re-publishes the 7 missed blog posts once the Resend key is restored: dates Apr 29, Apr 30, May 2 (×3), May 3 (×2). Operator picks which to retry; we do not auto-replay on key restore.

Out of scope

  • Rotating the actual secret — the operator does that
in the Replit secrets pane; this task only makes the system loudly surface the failure and stop lying about success.
  • Switching email providers or adding a fallback provider.
  • Changing how inbound webhook health is monitored (the existing
banner stays; we add a sibling outbound-health banner).
  • Reworking the Weekly Digest scheduler itself — it already records
to , so the new outbound-health banner picks it up for free.

Steps

1. Outbound-health signal — Add a derived health summary (success/fail counts + most recent error reason, grouped by error class, over the last 24h) computed from . Expose it alongside the existing webhook-health endpoint. 2. Comms Hub banner — Render the outbound-health summary as a prominent red banner when the failure rate crosses the threshold, keep the green webhook pill for inbound. Banner links to the filtered "Failed" view of the email log. 3. Auth-failure alert — In the daily scheduler tick, detect any 401/403/"API key is invalid" failures in the last 24h and send one summary alert to SuperAdmins (in-app + email). Dedupe per-day per-error-class to avoid spam. 4. Honest blog post recording — Refactor so the insert and the log line only fire on Resend success. On failure, log the error and do NOT mark the source file as posted, so the next tick can retry it. (Alternative: insert with an explicit column and exclude failed rows from the "already posted" check.) 5. Dev Blog Publisher visibility — Add a delivery-status column to the recent-posts list, surface the last successful send time, and add a per-post Retry button that re-runs the send through Resend. 6. Backfill helper — One-shot action (admin button or one-time endpoint) to re-publish the 7 missed blog posts in the April 29 – May 3 window after the key is restored. Operator picks which to retry; reuses the same Resend send path so the new health/honesty checks apply.

Relevant files

- - - - - -

Volleyball Elite Academy

Reply to this email — we read every reply.

You received this because you have an account with Volleyball Elite Academy.

elitevolleyball.training

No comments:

Post a Comment