WhatsApp class reminders at 24 hours and 2 hours, and a weak link I named out loud
Two reminder templates for an art school in Barcelona, one hourly sweep, a transactional send, and the one join that can quietly drop a student.
An art school in Barcelona sells classes, students forget. I wired class reminders into the AI assistant that already lives on WhatsApp for the school.
The design is small on purpose.
Two templates, two moments
- 24 hours before class. Template family
dp_class_reminder2_*, two buttons. Cancellation is still possible until the 12-hour cutoff the school enforces. - 2 hours before class. Template family
dp_class_soon_*, one button, “I’ll be there.” At this point cancellation is too late, so the button is informational, not transactional.
Each family exists in the languages the school speaks on WhatsApp, picked from the deal’s language field. The 24-hour template got two buttons on purpose: a student who cannot come should be able to tell us from the message, not have to open a chat and type.
One hourly sweep
A single function in app/reminders.py runs once an hour. It reads upcoming classes from the booking platform, matches each attendee to a deal in Kommo by phone number, and fires the right template through the matching bot:
- bot
97861for the 24-hour reminder - bot
97863for the 2-hour reminder
Hourly is coarse, and that is fine. A class two hours out gets reminded between 1 and 2 hours out, which is close enough for a parent getting ready, and 24 reads a day is a budget I can see on the booking platform.
No unsubscribe check in the template path
Reminders go out whether or not the person has opted out of marketing. The class is paid for, so the message is transactional, like a bank sending a payment receipt. The step that normally checks “are they still on the list” is not in these two bots, and that is deliberate. If I had put it there, a student who unsubscribed from the ads flow would silently stop getting class reminders, which is the exact failure mode I was hired to remove.
The flag that keeps it off
The sweep is behind a config flag, NOA_REMINDERS=false by default. Flipping it on is the school’s call, not mine. The reason is that there is no white list of who the reminders apply to, so when the flag flips, every student with an upcoming booking in the booking platform gets a message from the assistant. That is a decision the owner should make with her eyes open.
The weak link, named
The bridge between the booking platform and Kommo is the phone number. If a student booked with one number and writes to WhatsApp from another, the deal is not found and no reminder goes out. I did not fix this in code because I cannot: the booking platform does not expose the parent’s secondary numbers. What I did do was add a counter in the log for “no deal matched,” so when the flag flips, the school can see how often this really happens. If the number is small, we live with it. If it is big, the fix is on the booking platform side, not mine.
While I was in the Kommo database I checked whether the school ever has multiple contacts on the same deal: 1,601 deals have one contact, 28 have none, and zero have more than one. That meant I could ignore the “all contacts vs main contact” switch on the bot entirely, which cut one branch of the test matrix.
The one thing worth stealing
Say the weak link out loud, in the same page as the feature. A reminder flow that joins two systems by phone number will miss a student whenever the phone number does not match, and that is not a bug the client can see from the outside. A counter for it in the log, named for what it measures, lets the client find out early instead of six months later.