Skip to content

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

Merged
harshtandiya merged 3 commits into
developfrom
chore/guest-offline-booking-ack-email
Aug 27, 2026
Merged

feat(booking): acknowledge offline bookings before verification#388
harshtandiya merged 3 commits into
developfrom
chore/guest-offline-booking-ack-email

Conversation

@harshtandiya

@harshtandiya harshtandiya commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What changed

Closes #387.

An offline booking sits as a draft until an Event Manager verifies the payment, but nothing told the booker that. No email went out until approval, and a guest was shown the generic success panel claiming their tickets had already been sent — while the booking had no tickets at all.

Now the booking 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. The wording is overridable per event through 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 and no new Team Settings default.

The confirmation email's recipient resolution, argument building and send now live in shared methods both emails call, so the two cannot drift.

For guests the inline panel gains a pending variant carrying the booking reference — guests have no session to open /bookings/<name> with. Logged-in users already landed on the "Payment Confirmation Pending" booking page and are untouched, as is everything after approval: payment marked paid, booking submitted, tickets generated, existing confirmation and ticket emails sent.

Second commit is a bug the render turned up: ticket types autoname to integers while the Link field hands back a string, so the title map never matched and every attendee row in the booking confirmation email has printed the ticket type's id since it shipped.

Not in scope, all pre-existing: no email on rejection, approval still lives only in Desk, and offline bookings still record no Event Payment so they cannot be refunded.

Demo

01-offline-dialog 02-guest-pending 03-ack-email

Testing

  • TestOfflineAcknowledgementEmail (9 cases): recipient and reference fields, built-in template, args payload, per-event template override, the confirmation template must not leak in, event toggle off, Administrator/Guest skipped, plus one test that actually renders the new HTML — every other email test mocks frappe.sendmail, so a broken Jinja tag would otherwise ship.
  • test_offline_booking_acknowledges_then_confirms: creation sends exactly one mail and no tickets; approval then sends the confirmation and generates them.
  • bookingSuccessRedirect.test.ts: guest + offline is pending, guest without offline is not, logged-in offline unchanged.
  • Full suite green on a local site (600 + 69 Python, 104 dashboard unit tests); manual run of the guest offline flow end to end, with the acknowledgement landing in the Email Queue.

harshtandiya and others added 2 commits August 27, 2026 20:20
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
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
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

UI Demo Check — a screenshot or demo is attached.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a pre-verification acknowledgement for offline bookings, configurable per event, and introduces a dedicated pending result for guest checkout.

  • Shares recipient resolution, template rendering, and email arguments between acknowledgement and confirmation messages.
  • Displays the pending booking reference to guests while preserving the existing signed-in flow.
  • Corrects ticket-type title lookup when numeric document names are represented as strings.

Confidence Score: 4/5

The PR should not merge until the guest pending panel stops promising a verification email when booking emails are disabled.

The server deliberately suppresses acknowledgement and confirmation messages when the event disables booking emails, but the guest-offline success panel still unconditionally tells the guest that an email will follow verification.

Files Needing Attention: dashboard/src/components/BookingForm.vue

Important Files Changed

Filename Overview
buzz/api/booking/services.py Sends the new acknowledgement after persisting an offline booking while keeping email failure non-fatal.
buzz/ticketing/doctype/event_booking/event_booking.py Adds the acknowledgement sender and consolidates recipient resolution, rendering arguments, and dispatch for both booking emails.
buzz/events/doctype/buzz_event/buzz_event.json Adds the event-level acknowledgement-template override under the existing booking-email toggle.
buzz/templates/emails/offline_booking_acknowledgement.html Provides the built-in pending-payment acknowledgement with booking, attendee, and amount details.
dashboard/src/components/BookingForm.vue Adds the guest pending-verification panel, but its unconditional email promise remains inconsistent with events that disable booking emails.
dashboard/src/utils/bookingSuccessRedirect.ts Distinguishes guest offline responses as an inline pending result while leaving signed-in routing unchanged.

Reviews (2): Last reviewed commit: "chore(booking): tidy offline acknowledge..." | Re-trigger Greptile

Comment on lines +81 to +83
{{ __("We will email") }}
<strong>{{ guestEmail }}</strong>
{{ __("once the payment is verified.") }}

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 email still promised

When a guest makes an offline booking for an event with booking emails disabled, this panel still promises an email after verification, but get_booking_email_recipient suppresses that confirmation, leaving the guest waiting for an email that will never be sent.

Knowledge Base Used: Booking checkout and payment collection

Prompt To Fix With AI
This is a comment left during a code review.
Path: dashboard/src/components/BookingForm.vue
Line: 81-83

Comment:
**Disabled email still promised**

When a guest makes an offline booking for an event with booking emails disabled, this panel still promises an email after verification, but `get_booking_email_recipient` suppresses that confirmation, leaving the guest waiting for an email 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)

---

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 added the backport main backport to main branch label Aug 27, 2026
@harshtandiya

Copy link
Copy Markdown
Collaborator Author

Going to update email templates in a different PR

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
@harshtandiya
harshtandiya merged commit 0135896 into develop Aug 27, 2026
9 checks passed
@harshtandiya
harshtandiya deleted the chore/guest-offline-booking-ack-email branch August 27, 2026 17:39
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed for main, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin main
git worktree add -d .worktree/backport-388-to-main origin/main
cd .worktree/backport-388-to-main
git switch --create backport-388-to-main
git cherry-pick -x 013589655dda0705ee5b922e617ed9ada4f34882

harshtandiya added a commit that referenced this pull request Aug 27, 2026
…port #388) (#389)

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

* 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


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.


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.


Claude-Session: https://claude.ai/code/session_01Gs8LCCtLo5gVEbxaJURWuN

---------


(cherry picked from commit 0135896)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport main backport to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline bookings: incorrect guest success message and no acknowledgement email

1 participant