Building the core flow and transactional email
Your core flow is the reason a customer pays. For Bookwise it is the public booking page: a client chooses a service, a staff member and a slot, confirms, and both sides get an email. In this lesson you build that flow step by step, deal with the two hard parts of any booking product (free slots and time zones), and wire up confirmation emails the safe way.
Step 1: build the flow in thin slices
Do not ask the builder for the whole flow in one go. Ask for a thin vertical slice that works end to end, then thicken it. For Bookwise:
- Slice 1: the public page
/book/<salon-slug>lists active services. Choosing one shows the next 7 days with free 30-minute slots for "anyone". Confirming with name, email and phone creates an appointment. - Slice 2: choose a specific staff member; slots respect that person's working hours and existing appointments.
- Slice 3: confirmation emails and the cancel link.
- Slice 4: the salon's day and week view.
After each slice: test it on your phone, write the result in your change log, then ask for the next one.
Small requests give better builds. "Add slice 2 as described" with five precise rules beats one page with twenty rules, because you can see immediately which rule did not land.
Step 2: get the slot calculation right
The slot calculation is the heart of a booking tool. Describe it exactly:
Free slots for a service S, staff member P, on date D:
- Start from P's working hours on D's weekday (in the salon's time zone).
- Step through them in 15-minute increments.
- A start time T is free if [T, T + S.duration) lies fully inside the
working hours and does not overlap any appointment of P with status
"booked".
- Do not show slots that start less than 2 hours from now.
- For "anyone": a slot is free if at least one active staff member is
free; assign the first free one when booking.
- On confirm, check again on the server inside a transaction. If the
slot was taken in the meantime, show "This time was just booked,
please pick another" and do not create the appointment.That last rule is what protects you when two clients click the same slot. It works together with the database constraint from module 1.
Step 3: handle time zones once, properly
Time bugs are the most common complaint in booking software. Three rules:
- Store every moment in UTC (
starts_at,ends_at). - Calculate working hours and slots in the salon's time zone, using a named zone like
Europe/Amsterdam, never a fixed offset like+01:00; the offset changes twice a year. - Show times in the salon's time zone on the booking page and in emails, and say so ("All times are in Amsterdam time").
Test the two nights a year when clocks change: book a 09:00 appointment on the Monday after the switch and check it still shows 09:00.
Step 4: transactional email
If you switched Transactional email on in the blueprint, the builder sets up sending for your app. What you still decide is which emails go out and what they say.
Bookwise sends four emails in v1:
| To | When | Must contain | |
|---|---|---|---|
| Booking confirmation | Client | On booking | Service, staff, date and time with time zone, salon address, cancel link |
| New booking notice | Salon (owner or staff) | On booking | Client name, service, time |
| Cancellation confirmation | Client and salon | On cancel | What was cancelled |
| Staff invitation | New staff | On invite | Single-use link, expiry |
Write the four transactional emails for [product name], a booking tool for [type of business]. For each: a subject line under 50 characters, a plain-text body under 120 words, and placeholders in {curly_braces} for salon name, client name, service, staff, date, time, time zone, address and links. Tone: [friendly, clear]. Do not include marketing content; these are service emails. Mention that the client can cancel until [24] hours before.Give the result to the builder as one request: "Use exactly these templates for the four emails."
If the app sends through a my-app mailbox
The platform has its own mailboxes on your domains (the Mail page of my-app.engineer). When an app must send mail itself, such as booking confirmations, you connect it with the mail_connect_app tool: the app then receives SMTP_* settings in its environment, and its code reads only those.
Never put a mailbox password in your code, a config file or the chat. If the builder or Claude suggests hard-coding SMTP credentials, refuse and use the SMTP_* environment settings from mail_connect_app instead. Whether the builder's own transactional email setup or a my-app mailbox is the better fit for your app is not spelled out in the docs: check in your dashboard which sender your app uses.
Deliverability basics
Confirmation emails that land in spam generate support questions. Send from your own domain (module 4 connects it), keep emails short and transactional, and make sure your domain has SPF, DKIM and DMARC records. The course Email marketing and automation goes deeper.
Step 5: the cancel link
The cancel link must work without a login, yet nobody else may cancel. The standard solution:
- each appointment gets a long random
cancel_token(not the appointment id); - the link is
/cancel/<token>; - the page shows the appointment and a confirm button (do not cancel on a plain GET request; email scanners open links);
- after the cut-off (24 hours before), the page says "Please call the salon" with the phone number.
Step 6: test the full flow
Run this script after every build that touches the flow:
- Book as a client on your phone, on mobile data (not your Wi-Fi).
- Check both emails arrive, and not in spam.
- Try to book the same slot again in a second browser: it must be refused.
- Cancel via the link; the slot must become free again.
- Try the cancel link a second time and after the cut-off.
- Check the salon day view shows the right times.
Booking confirmations are service messages, but if you add marketing (newsletters, offers) to them you need consent under e-privacy and GDPR rules in the EU, and national rules apply on top: for example the Telecommunicatiewet in the Netherlands, PECR in the UK or the Prawo telekomunikacyjne in Poland. Keep v1 emails purely transactional.
Bookwise
Slice 1 worked on the first build. Slice 2 showed a bug: a stylist working 09:00 to 17:00 was offered a 16:30 slot for a 60-minute colour treatment. The founder added the rule "the whole duration must fit inside the working hours" and the next build fixed it. The emails were written with the Claude prompt above and pasted into the manager chat as one request.
Build your core flow in thin slices, describe the slot rules precisely, set up the four emails (or your equivalent) and run the six-step test. Log every build and its result.
This course is general information, not personal legal, tax or financial advice. Rules, amounts and dates change: check the official source for your country before you act.