Booking and scheduling
CRM booking lets a business publish meeting times that people can book without a CRM account. A booking keeps the guest, host, time, CRM record, calendar meeting, and later messages together so the public booking flow and internal CRM work stay in step.
Booking model
Booking pages and hosts
The CRM Booking Page is the main scheduling agreement. It names the meeting, its public route, duration, location, hosts, hours, limits, form, and follow-up rules. A page can assign several CRM users as hosts. The system gives a booking to a free host in turn, which lets one public link represent a team. crm/…/crm_booking_page.json• L39-227 crm/…/crm_booking_page.py• L14-71
Hosts must be active CRM users. Each host row is part of the page rather than a separate public resource. Host calendar connections add the host's external busy time and can provide a meeting link. Booking pages and public scheduling explains the page settings and public page in more detail. crm/…/crm_booking_page_host.json• L11-42 crm/…/booking.py• L270-296
References: crm/…/crm_booking_page.json• L39-227 crm/…/crm_booking_page.py• L46-71 crm/…/crm_booking_page_host.json• L11-42 frontend/…/BookingPageEditor.vue• L159-210
Booking records and CRM links
The CRM Booking record is the durable result of a scheduled meeting. It stores the page, chosen host, confirmed or cancelled state, time, guest contact data, form answers, secret management token, calendar event, and linked CRM record. This gives the business a meeting history even when the public page later changes or goes offline. crm/…/crm_booking.json• L30-166
When a guest books, CRM first looks for a matching open lead or deal. If it finds one, the booking links to that record without changing its existing data. If it finds none and the page allows record creation, it creates the page's chosen record type and assigns it to the host. crm/…/booking.py• L513-546
References: crm/…/crm_booking.json• L30-166 crm/…/booking.py• L104-136 crm/…/booking.py• L513-546 frontend/…/BookingPageEditor.vue• L585-621
Public scheduling
Availability calculation
The public page shows only times that satisfy the page's weekly hours and booking limits. The calculation applies the page timezone, holiday list, minimum notice, maximum days ahead, meeting duration, slot interval, and buffer before it checks each host's busy time. Busy time comes from CRM events and, when connected, Google Calendar. crm/…/booking.py• L552-623
The public interface displays these results in the visitor's selected timezone. It asks the server for a bounded date range and then presents open days and times. A host's own meeting is excluded during rescheduling, so the guest can move that meeting without treating its current time as a conflict. crm/…/booking.py• L61-71 crm/…/crm_book.js• L98-115 crm/…/booking.py• L173-197
This diagram shows how page rules and calendar conflicts become the times a visitor can select.
flowchart LR
P[Booking page rules] --> H[Weekly hours and holidays]
H --> L[Notice, horizon, duration, interval, buffer]
L --> B[CRM and connected calendar busy time]
B --> S[Open time slots]
S --> V[Visitor calendar]
References: crm/…/booking.py• L552-623 crm/…/booking.py• L578-612 crm/…/booking.py• L698-769 crm/…/crm_book.js• L193-245
Booking submission
A visitor selects a slot and completes the page's own CRM form. The form always requires an email so CRM can identify the guest and send booking details. Visible required fields and field rules are checked again on the server before the booking is accepted. crm/…/crm_booking_page.py• L73-101 crm/…/booking.py• L387-429
The server checks the slot again while it creates the booking. It protects the host and guest limits from parallel requests, chooses a free host, links or creates the CRM record, saves the booking, and creates its calendar event. If another visitor takes the slot first, the public page receives a conflict and asks the visitor to choose again. crm/…/booking.py• L74-136 crm/…/booking.py• L439-468
References: crm/…/booking.py• L74-136 crm/…/booking.py• L395-429 crm/…/booking.py• L439-468 crm/…/crm_book.js• L351-429
Guest booking management
The confirmation link contains a secret token that lets the guest view that booking without signing in. The guest can use the same public page to reschedule or cancel an upcoming meeting. Each action updates the booking and its event, then sends the related messages. crm/…/booking.py• L139-197 crm/…/crm_book.js• L432-541
The page exposes only the booking's public details. It does not expose internal CRM form answers as part of the guest booking response, while the answers remain available to the host through the booking and meeting records. Cancelled and past meetings no longer offer guest management actions. crm/…/booking.py• L318-345 crm/…/crm_book.js• L453-501
References: crm/…/booking.py• L139-197 crm/…/booking.py• L318-345 crm/…/crm_book.js• L432-541 crm/…/crm_book.html• L90-143
Meeting and notification lifecycle
Calendar meeting
Each confirmed booking creates a private CRM Event owned by the selected host. The event carries the meeting time, location, guest summary, form answers, and link to the booking's CRM record. When the host has a connected Google Calendar, CRM also tries to sync the event and can request a Google Meet link. crm/…/booking.py• L798-844
The booking and event remain related after creation. A host move, cancellation, or deletion flows back to the booking so the public status and guest email match the internal calendar. A failed Google operation does not discard the CRM booking; the CRM event remains the source for the local meeting record. crm/…/booking.py• L870-975 crm/hooks.py• L261-267
References: crm/…/booking.py• L798-844 crm/…/booking.py• L870-975 crm/hooks.py• L261-267 frontend/…/event.js• L359-409
Booking notifications
Booking messages cover confirmation, rescheduling, cancellation, and an optional guest reminder. The guest receives the meeting time, location or join link, an iCalendar attachment for normal booking changes, and a link to manage the meeting. The host receives the guest details and a link to the related CRM record. crm/…/booking.py• L978-1059 crm/…/crm_booking.html• L1-41
CRM also creates an in-app booking notification for the host. If the linked lead or deal has another owner, that owner receives a notification as well. A scheduled task sends selected guest reminders and checks for meetings closed outside CRM. crm/…/booking.py• L1062-1095 crm/…/booking.py• L1144-1190 crm/hooks.py• L362-370
References: crm/…/booking.py• L978-1059 crm/…/booking.py• L1062-1095 crm/…/booking.py• L1144-1190 crm/…/crm_booking.html• L1-41 crm/hooks.py• L362-370
Access and administration
Internal access
Sales users can view booking pages, while page hosts and sales managers can change the pages they control. Booking visibility follows the host and the user's access to the linked lead or deal. This keeps scheduling useful to sales teams without making every booking visible to every user. crm/…/crm_booking_page.py• L123-151 crm/…/crm_booking.py• L24-54
The settings area is the internal starting point for creating pages, copying public links, previewing pages, turning pages on or off, and editing their details, availability, form, and sharing options. A page with bookings is kept so its historical links remain valid; turning it off stops new public bookings. frontend/…/BookingPagesList.vue• L1-15 frontend/…/BookingPagesList.vue• L240-298
References: crm/…/crm_booking_page.py• L123-151 crm/…/crm_booking.py• L24-54 frontend/…/BookingPagesList.vue• L1-15 frontend/…/BookingPagesList.vue• L240-298
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to page hours or time rules must preserve the same rules used by the slot query and the public calendar display.
- Changes to the booking form must keep email required and keep server-side validation aligned with the fields shown to guests.
- Changes to booking or event status must preserve the two-way link so host calendar changes still update guest-facing state and email.
- Changes to record matching or creation must keep the booking reference, record owner, and host notification relationship consistent.
- Changes to reminder options must update both the page values and the scheduled reminder scan.
- Changes to public routes or booking tokens must preserve links already sent in confirmation and management emails.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A visitor submits a slot after another booking takes it | No duplicate meeting is created; the visitor must choose again | Host locking and a final availability check return a slot conflict |
| A page is disabled | Guests cannot book from it, while permitted staff can still preview it | Public page lookup requires an enabled page for booking |
| Weekly hours overlap or end before they start | The page cannot be saved with an ambiguous schedule | Page validation rejects invalid hour ranges |
| Google Calendar cannot answer or sync | Local availability and CRM history continue, but external busy data or a Meet link may be missing | Google failures are logged and the CRM event remains available |
| A host moves or deletes a booked event | The booking can become out of date or cancelled unless it is synchronized | Event hooks update the booking and notify the guest |
| A page with existing bookings is deleted | Historical bookings would lose their page relationship | The settings flow turns the page off instead of deleting it |
Key files
| File | Why to read it |
|---|---|
| crm/…/booking.py | Main booking service. It joins page rules, availability, persistence, calendar events, guest actions, and notifications. |
| crm/…/crm_booking_page.json | Defines the business settings that control a public booking page. |
| crm/…/crm_booking.json | Defines the durable meeting and guest record. |
| crm/…/crm_book.py | Builds the public page context and exposes page data and form fields. |
| crm/…/crm_book.js | Shows the public visitor flow from slot selection through booking management. |
| frontend/…/BookingPageEditor.vue | Shows how staff configure page details, availability, forms, and follow-up behavior. |
| frontend/…/BookingPagesList.vue | Shows page creation, sharing, activation, and retention behavior. |
| crm/…/crm_booking.html | Defines the guest and host booking message content. |
| crm/hooks.py | Connects event changes and scheduled jobs to booking synchronization and reminders. |