Skip to content

feat(booking): acknowledge offline bookings before verification (backport #388) - #389

Merged
harshtandiya merged 1 commit into
mainfrom
backport-388-to-main
Aug 27, 2026
Merged

feat(booking): acknowledge offline bookings before verification (backport #388)#389
harshtandiya merged 1 commit into
mainfrom
backport-388-to-main

Conversation

@harshtandiya

Copy link
Copy Markdown
Collaborator

What changed

Manual backport of #388 to main. The automated backport could not cherry-pick it: main predates Buzz Team Settings, so the booking email code it touches reads its defaults from the Buzz Settings single 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_email falls back to Buzz Settings.default_booking_confirmation_email_template, and get_booking_email_args reads Buzz Settings.support_email, in place of get_event_team_settings.
  • TestOfflineAcknowledgementEmail configures Buzz Settings rather than team settings, matching the sibling TestBookingConfirmationEmail on this branch.
  • Buzz Event's type annotations gain only the fields this branch's DocType actually has.

Everything else is the merge commit verbatim.

Demo

Same as #388 — no UI change beyond what that PR shipped.

Testing

  • yarn test:unit green (43 tests) on this branch.
  • Python suite is left to CI here: the local sites carry the develop schema, so a run against them would not prove anything about this branch.

* 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)
@harshtandiya harshtandiya added the backport This PR / Issue is a backport for a branch other than develop label Aug 27, 2026
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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.

  • Adds event-level offline acknowledgement template configuration and a built-in email template.
  • Refactors booking email recipient, template rendering, and attendee-summary construction into shared helpers.
  • Routes guest offline responses to an inline pending panel and keeps signed-in users on the booking-detail path.
  • Adds backend and dashboard tests for acknowledgement behavior, template rendering, and success-action selection.

Confidence Score: 4/5

The 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

Important Files Changed

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.

Fix all with Greploop Fix All in Claude Code Fix All in Codex

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

Comment on lines +80 to +82
}}
{{ __("We will email") }}
<strong>{{ guestEmail }}</strong>

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.

P1 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.

Fix in Claude Code Fix in Codex

"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),

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.

P2 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

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.

Fix in Claude Code Fix in Codex

@harshtandiya
harshtandiya merged commit 253d15d into main Aug 27, 2026
9 checks passed
@harshtandiya
harshtandiya deleted the backport-388-to-main branch August 27, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR / Issue is a backport for a branch other than develop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant