Skip to content

fix: show booking answers in host emails - #132

Closed
harley wants to merge 2 commits into
Calnode:mainfrom
harley:fix/host-booking-answers
Closed

harley wants to merge 2 commits into
Calnode:mainfrom
harley:fix/host-booking-answers

Conversation

@harley

@harley harley commented Oct 6, 2026

Copy link
Copy Markdown

Summary

Hosts now see a guest's saved intake responses in new-booking and reassignment emails. The responses were stored before, but the notifications omitted them.

Risks

Guest-provided text now appears in email to assigned hosts. HTML escapes that text, and attendee confirmations do not include it. If loading responses fails, the email still sends without them and logs the error.

Validation

  • make build and go test ./... passed on this branch.
  • Rendered a sample host email in Chromium and checked multiline answers and layout.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution! Before we can merge it, please read our Contributor License Agreement and sign it by posting the exact comment below in this PR.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one coverage nit below.

Reviewed changes

  • Host email templates — BookingData.Answers ([]BookingAnswer{Label,Value}) renders in the host plain-text and HTML confirmations only; the attendee templates don't reference it, so no leak path.
  • Answer loading — new bookingAnswersForEmail joins booking_answers to event_type_questions, ordered by question position, mirroring the existing admin GetBookingAnswers query.
  • Wiring — invoked at the two host-notify sites: dispatchBookingConfirmation (shared by REST + MCP) and reassign.go, with failures logged and the email still sent.
  • Tests — unit test pins host-only inclusion plus HTML escaping; integration test pins end-to-end host email content.

Verified: both new tests pass, go test ./internal/mailer/ ./internal/handler/ is green, and go vet / gofmt are clean. HTML is auto-escaped by html/template while the plain-text path correctly does not escape; the inner join is safe because booking_answers.question_id is ON DELETE CASCADE (migration 00014).

ℹ️ Nitpicks

  • The reassignment call site (internal/handler/reassign.go:216) is the second use of the new helper but has no test asserting answers reach the reassigned host, while the create path is covered end-to-end. Optional, but a small reassign-email assertion would close the gap.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

@harley

harley commented Oct 6, 2026

Copy link
Copy Markdown
Author

The reassignment call site ... has no test asserting answers reach the reassigned host.

Added that assertion in f9d2e5d. It checks the saved answer in both the new host's plain-text and HTML email. go test ./... passes.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Reassignment email coverage — TestReassignBooking_movesHost now seeds a question and answer, then waits for the email to the new host and asserts both label and value appear in text and HTML. It would fail without the reassign.go:216 wiring, so it genuinely closes the prior review's coverage nitpick.

Verified: go test ./internal/handler/ passes, and the incremental delta is test-only — no production behavior changed since the prior review.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash | 𝕏

@harley harley closed this Oct 6, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant