fix: missed-reservation email — format its times, and alert on the week actually missed - #102
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This template did not move when the booking emails were rewritten in #79 and drifted from them. It rendered its times straight out of the payload, so an alert read "Time of Reservation: 18:30:00 to 20:00:00" where every other Chambers email said "6:30 PM to 8:00 PM". Both shapes the codebase produces are handled now -- Postgres returns HH:MM:SS and the booking forms submit HH:MM. It also took its date already formatted, via a second copy of the date formatter living under a different name. That is probably why the raw times survived so long: the one value the caller prepared looked right, and the two it passed through did not. It takes raw values and formats them here now, like every other template, and formatDateLong is gone -- it was character-for-character what changes.formatDate already did. The subject follows the house style, an em dash rather than a hyphen. Two smaller things while the file was open. The room or table is now named, since the point of the alert is that a room went unused and Operational Affairs would otherwise have to look it up. And a body with no leadership on file reads "Contacts: None on file" rather than trailing off after the colon. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pataniaeli
force-pushed
the
fix/issue-99-missed-reservation-email
branch
from
September 10, 2026 00:30
2c141fa to
dee560a
Compare
Two things were wrong with asking "is anything Missed". It described the alert using the series' start date and time no matter which week had actually been missed, so a series where week 7 was missed told Operational Affairs about week 1. That is the same defect as #91, in the one caller that rewrite did not reach. And because a missed week stays Missed, the condition stayed true forever. Every later edit to the series sent another alert about a week they had been told about weeks earlier, with the wrong date on it. movedOccurrences -- which #91 added to answer exactly this question -- is what this save changed, so a week now alerts on the edit that missed it and not again afterwards. A series-level Missed is compared against the stored value for the same reason, so resubmitting an already-missed series does not re-alert either. One alert per missed reservation rather than one per save: each missed room is its own incident to chase, and a single email naming one of several would hide the rest. Occurrence values fall back to the series, so the times and room are the ones that actually applied to the week missed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two real defects in the missed-reservation alert, found while looking for that one.
1. It rendered raw times
where every other Chambers email says
6:30 PM to 8:00 PM. This template did not move when the booking emails were rewritten in #84. Verified by rendering both templates fromdevside by side. Both shapes the codebase produces are handled now — Postgres returnsHH:MM:SS, the forms submitHH:MM.It also took its date already formatted, via a second copy of the date formatter under a different name (
formatDateLong, character-for-character whatchanges.formatDatealready did). That is likely why the raw times survived: the one value the caller prepared looked right, and the two it passed straight through did not. The template formats its own values now and the duplicate is gone. The subject follows the house style — an em dash rather thanChambers Alert -.The room or table is now named, since the point of the alert is that a room went unused. A body with no leadership on file reads
Contacts: None on filerather than trailing off after the colon.2. It alerted on the wrong week, forever
The weekly caller asked "is anything Missed", then described the alert using the series' start date and time regardless of which week was missed. A series where week 7 was missed told Operational Affairs about week 1 — the same defect as #91, in the one caller that rewrite did not reach.
Worse: a missed week stays Missed, so the condition stayed true permanently. Every later edit to the series sent another alert about a week they had been told about weeks earlier, with the wrong date on it.
movedOccurrences— added by #91 to answer exactly this question — is what this save changed, so a week alerts on the edit that missed it and not again. A series-level Missed is compared against the stored value for the same reason. One alert per missed reservation rather than per save: each missed room is its own incident, and one email naming one of several would hide the rest.What was checked on the logo
maincontains9367c83, which pointedLOGO_URLatopsemaillogo.png; there had never been ansga-logo.png, so the footer logo 404'd in every transactional email until v1.14.0.https://chambers.northeasternsga.com/opsemaillogo.pngreturns200 image/png, 59,633 bytes,Content-Disposition: inline, CORS open.<img>this template emits is byte-identical to the one inbooking-updated, which renders fine.So the markup and the asset were both correct; the recipient's client declined to load it.
Verification
npm run build,tscandeslintclean, rebased onto currentdev(post-#97). Templates rendered by intercepting Resend, withHH:MM:SSandHH:MMinputs and an empty contacts list; markup checked for balance.🤖 Generated with Claude Code