Skip to content

fix: missed-reservation email — format its times, and alert on the week actually missed - #102

Merged
pataniaeli merged 2 commits into
devfrom
fix/issue-99-missed-reservation-email
Sep 10, 2026
Merged

fix: missed-reservation email — format its times, and alert on the week actually missed#102
pataniaeli merged 2 commits into
devfrom
fix/issue-99-missed-reservation-email

Conversation

@pataniaeli

@pataniaeli pataniaeli commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

On the logo, which is what #99 was reported for: not a code bug. Outlook was blocking the images because the sender is not trusted there. Production had the correct <img> and a working URL at the time the email was sent — verified below. Nothing in this PR addresses it, and no Closes line: #99 should be closed on its own merits.

Two real defects in the missed-reservation alert, found while looking for that one.

1. It rendered raw times

Time of Reservation: 18:30:00 to 20:00:00

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 from dev side by side. Both shapes the codebase produces are handled now — Postgres returns HH:MM:SS, the forms submit HH:MM.

It also took its date already formatted, via a second copy of the date formatter under a different name (formatDateLong, character-for-character what changes.formatDate already 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 than Chambers 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 file rather 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

  • main contains 9367c83, which pointed LOGO_URL at opsemaillogo.png; there had never been an sga-logo.png, so the footer logo 404'd in every transactional email until v1.14.0.
  • Production is serving v1.14.0, and https://chambers.northeasternsga.com/opsemaillogo.png returns 200 image/png, 59,633 bytes, Content-Disposition: inline, CORS open.
  • The <img> this template emits is byte-identical to the one in booking-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, tsc and eslint clean, rebased onto current dev (post-#97). Templates rendered by intercepting Resend, with HH:MM:SS and HH:MM inputs and an empty contacts list; markup checked for balance.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
chambers Ready Ready Preview Sep 10, 2026 12:41am UTC

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
pataniaeli force-pushed the fix/issue-99-missed-reservation-email branch from 2c141fa to dee560a Compare September 10, 2026 00:30
@pataniaeli pataniaeli changed the title fix: bring the missed-reservation email in line with the others (#99) fix: format the times in the missed-reservation email, and drop its duplicate date formatter Sep 10, 2026
@pataniaeli pataniaeli self-assigned this Sep 10, 2026
@pataniaeli pataniaeli added the bug Something isn't working label Sep 10, 2026
@pataniaeli pataniaeli linked an issue Sep 10, 2026 that may be closed by this pull request
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>
@pataniaeli pataniaeli changed the title fix: format the times in the missed-reservation email, and drop its duplicate date formatter fix: missed-reservation email — format its times, and alert on the week actually missed Sep 10, 2026
@pataniaeli
pataniaeli merged commit a74d1a5 into dev Sep 10, 2026
4 checks passed
@pataniaeli
pataniaeli deleted the fix/issue-99-missed-reservation-email branch September 10, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reservation missed email renders improperly

1 participant