feat(booking): acknowledge offline bookings before verification (backport #388) - #389
Conversation
* feat(booking): acknowledge offline bookings before verification An offline booking is a draft until an Event Manager verifies the payment, but nothing said so. The booker got no email at all until approval, and a guest was shown the generic success panel claiming their tickets had already been sent. Send an acknowledgement when the booking is created: booking reference, event and participant details, the offline method and amount, and a clear statement that the tickets are not confirmed yet and a separate confirmation will follow. The wording is overridable per event via a new Offline Payment Acknowledgement Email Template field; the existing "Send Booking Confirmation Email" check gates both booking emails, so there is no second toggle to keep in sync. The confirmation email's recipient resolution, argument building and send now live in shared methods that both emails call, so the two cannot drift. For guests, the inline panel gains a pending variant carrying the booking reference. Logged-in users already landed on the "Payment Confirmation Pending" booking page and are unchanged, as is everything after approval. Fixes #387 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gs8LCCtLo5gVEbxaJURWuN * fix(booking): show ticket type titles in booking emails Ticket types autoname to integers, but a Link field hands the value back as a string, so the title map built from `get_all` never matched and every attendee row printed the ticket type's id where its title belongs. Cast both sides. Caught while rendering the new offline acknowledgement against a real booking; the booking confirmation email has printed ids since it shipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gs8LCCtLo5gVEbxaJURWuN * chore(booking): tidy offline acknowledgement after review Regenerate Buzz Event's type annotations, which had drifted since the booking confirmation fields landed. Drop a dead branch in the acknowledgement template: a zero-total booking takes the free path, so an offline one is never a free event. Cover the gateway path, which must stay silent until the payment lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gs8LCCtLo5gVEbxaJURWuN --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 0135896)
Greptile SummaryThis backport adds an immediate acknowledgement email and a distinct pending UI state for offline bookings while retaining confirmation and ticket issuance for the later approval step.
Confidence Score: 4/5The unconditional promise of a later email should be corrected before merging because events with booking emails disabled will never send it. The pending guest UI diverges from the backend email toggle, while the new acknowledgement also presents inconsistent participant and subtotal amounts for partially applied free-ticket coupons. Files Needing Attention: dashboard/src/components/BookingForm.vue; buzz/ticketing/doctype/event_booking/event_booking.py; buzz/templates/emails/offline_booking_acknowledgement.html
|
| Filename | Overview |
|---|---|
| buzz/api/booking/services.py | Sends a best-effort acknowledgement after an offline booking is saved in its pending-verification state. |
| buzz/ticketing/doctype/event_booking/event_booking.py | Introduces shared booking-email helpers, but free-ticket coupon rows use a different discount basis from the acknowledgement subtotal. |
| buzz/templates/emails/offline_booking_acknowledgement.html | Adds the pending-payment receipt with event, attendee, payment, and support details; partial free-ticket discounts can produce inconsistent line totals. |
| buzz/events/doctype/buzz_event/buzz_event.json | Adds event-level acknowledgement-template configuration under the existing booking-email toggle. |
| dashboard/src/components/BookingForm.vue | Adds the guest pending panel, but promises a later email even when event configuration suppresses booking emails. |
| dashboard/src/utils/bookingSuccessRedirect.ts | Extends guest-inline actions with the offline pending-verification state while preserving gateway and explicit redirect priority. |
Prompt To Fix All With AI
### Issue 1
dashboard/src/components/BookingForm.vue:80-82
**Disabled emails still promised**
When `send_booking_confirmation_email` is disabled, this panel still tells an offline guest that an email will arrive after verification, while the backend suppresses both acknowledgement and confirmation emails. The guest therefore waits for a message that will never be sent.
### Issue 2
buzz/ticketing/doctype/event_booking/event_booking.py:261
**Coupon totals mix bases**
For a partially discounted free-ticket booking, these participant amounts use the coupon-mutated attendee prices while the acknowledgement labels the unchanged pre-coupon `net_amount` as its subtotal. The participant lines consequently do not add up to the displayed subtotal, making the emailed payment breakdown inconsistent.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(booking): acknowledge offline booki..." | Re-trigger Greptile
| }} | ||
| {{ __("We will email") }} | ||
| <strong>{{ guestEmail }}</strong> |
There was a problem hiding this comment.
Disabled emails still promised
When send_booking_confirmation_email is disabled, this panel still tells an offline guest that an email will arrive after verification, while the backend suppresses both acknowledgement and confirmation emails. The guest therefore waits for a message that will never be sent.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: dashboard/src/components/BookingForm.vue
Line: 80-82
Comment:
**Disabled emails still promised**
When `send_booking_confirmation_email` is disabled, this panel still tells an offline guest that an email will arrive after verification, while the backend suppresses both acknowledgement and confirmation emails. The guest therefore waits for a message that will never be sent.
**Knowledge Base Used:**
- [Booking checkout and payment collection](https://app.greptile.com/bwh-tech/-/custom-context/knowledge-base/bwhtech/buzz/-/docs/booking-checkout.md)
- [Dashboard booking experience](https://app.greptile.com/bwh-tech/-/custom-context/knowledge-base/bwhtech/buzz/-/docs/dashboard-booking-experience.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| "ticket_type_title": ticket_type_titles.get(attendee.ticket_type, attendee.ticket_type), | ||
| "ticket_type_title": ticket_type_titles.get(str(attendee.ticket_type), attendee.ticket_type), | ||
| "number_of_add_ons": attendee.number_of_add_ons, | ||
| "amount": (attendee.amount or 0) + (attendee.add_on_total or 0), |
There was a problem hiding this comment.
For a partially discounted free-ticket booking, these participant amounts use the coupon-mutated attendee prices while the acknowledgement labels the unchanged pre-coupon net_amount as its subtotal. The participant lines consequently do not add up to the displayed subtotal, making the emailed payment breakdown inconsistent.
Knowledge Base Used: Booking checkout and payment collection
Prompt To Fix With AI
This is a comment left during a code review.
Path: buzz/ticketing/doctype/event_booking/event_booking.py
Line: 261
Comment:
**Coupon totals mix bases**
For a partially discounted free-ticket booking, these participant amounts use the coupon-mutated attendee prices while the acknowledgement labels the unchanged pre-coupon `net_amount` as its subtotal. The participant lines consequently do not add up to the displayed subtotal, making the emailed payment breakdown inconsistent.
**Knowledge Base Used:** [Booking checkout and payment collection](https://app.greptile.com/bwh-tech/-/custom-context/knowledge-base/bwhtech/buzz/-/docs/booking-checkout.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
What changed
Manual backport of #388 to
main. The automated backport could not cherry-pick it:mainpredates Buzz Team Settings, so the booking email code it touches reads its defaults from theBuzz Settingssingle instead.Same behaviour as #388 — an offline booking now sends an acknowledgement the moment it is created (booking reference, event and participant details, offline method and amount, and a plain statement that the tickets are not confirmed yet and a separate confirmation will follow), and guests see a pending panel instead of the success panel claiming their tickets were sent. Includes the ticket-type title fix and the post-review tidy-ups from the same PR.
Adapted for this branch:
send_booking_confirmation_emailfalls back toBuzz Settings.default_booking_confirmation_email_template, andget_booking_email_argsreadsBuzz Settings.support_email, in place ofget_event_team_settings.TestOfflineAcknowledgementEmailconfiguresBuzz Settingsrather than team settings, matching the siblingTestBookingConfirmationEmailon this branch.Everything else is the merge commit verbatim.
Demo
Same as #388 — no UI change beyond what that PR shipped.
Testing
yarn test:unitgreen (43 tests) on this branch.developschema, so a run against them would not prove anything about this branch.