Skip to content

Host cancellation emails always say "cancelled by admin" #90

Closed

Description

@shockalotti

From discussion #61 (ovizii).

Repro: log in as a non-admin host, create availability + event types, make a test booking, cancel it from the bookings page. The cancellation email says Reason: cancelled by admin, even though an ordinary team member cancelled.

Root cause: frontend/src/routes/bookings/+page.svelte hardcodes { reason: "cancelled by admin" }, the backend (POST /v1/bookings/{id}/cancel, CancelBooking in internal/handler/booking_handler.go) stores it verbatim, and the mailer prints it.

Fix: attribute server-side. AuthUser already carries Name/Email/Role() — compose the reason in CancelBooking (e.g. Cancelled by {name}) instead of trusting the client string. Booker manage-link cancels and system cancels (unpaid expiry) are unaffected.

Discussion: #61

Activity

  1. pullfrog commented on Sep 22, 2026

    @pullfrog
    Contributor
  2. shockalotti commented on Sep 26, 2026

    @shockalotti
    ContributorAuthor

    Fixed on main. The bookings page sent a hardcoded "cancelled by admin" string that the server stored verbatim, so every member cancel emailed as an admin cancel. The server now composes the reason itself - "Cancelled by {name}" - from the authenticated caller, and ignores the client string. Booker cancels via manage links and system cancels are untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions