Skip to main content
Cookbook Marketing Amelia

Register Someone for an Amelia Class or Event with AI

Book someone onto an Amelia class or event after checking it is open and has places left.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running Amelia (Booking for Appointments and Events Calendar) 2.4.15 or newer (tested on 2.4.15, free) on WordPress 6.9 or newer, with an administrator account.

The prompt
My site uses Amelia for bookings. Register [the person's name and email] [and how many people in total, if more than one] for [the event, for example Saturday's yoga workshop].

1. Run discover_abilities with category amelia-read, then with category amelia-write. If the amelia abilities this needs are not listed, stop and tell me to install or update the free Amelia booking plugin (Booking for Appointments and Events Calendar, 2.4.15 or newer, on WordPress 6.9 or newer). If an amelia ability answers that I am not allowed, tell me WPVibe must be connected as an administrator, then stop.
2. Amelia takes and gives dates and times in the site's own timezone, as YYYY-MM-DD HH:mm. Run amelia/list-events with a search for one word of the event (it covers today through the next 90 days; for a later event pass dates as two YYYY-MM-DD days). If several match, show me their names, dates, prices and places left (maxCapacity minus spotsSold) and ask which one. If none match, tell me and stop: amelia/list-events only lists events shown on the site, so a hidden event has to be shown in Amelia first.
3. Check it can take bookings: if its first periodStart has passed, its status is not approved, or closed is true, tell me it is not open for booking and stop. If opened is false, tell me sign-ups for it have not opened yet and ask whether to book anyway. Then check there is room: places left is maxCapacity minus spotsSold. If full is true or places left is fewer than the number of people, tell me it is full and stop. Do not book anyway: Amelia's book-event does not stop at the limit. If bookMultipleTimes is true, tell me the event lets one person book more than once, so Amelia will not catch a repeat, and ask me whether they are already registered before going on. If the number of people is more than 1 and bringingAnyone is false, tell me the event is set to one person per booking and ask whether to go on: book-event does not stop that either.
4. Run amelia/list-customers with a search for the person's email, then their last name. If several match, show me them and ask which one. If you find one, show me the record and ask if it is the right person. If not, show me the first name, last name and email you would add and wait for my yes; then run amelia/add-customer. If it answers that the email already exists, search again by that email and use that record; if that still finds no client, tell me the email belongs to someone else in Amelia, such as a staff member, and stop.
5. Show me one summary: event, date and time, price per person, number of people, and the person's name and email. Tell me that booking is final from here and that Amelia emails them when its email is set up. Wait for my yes.
6. On my yes, run amelia/book-event once with eventId, customerId and persons. If it answers that they have already booked this event, tell me and stop.
7. Run amelia/list-events again with the same search and dates and confirm spotsSold went up by the number of people. Tell me the booking id (the id inside booking in the result). If I ever ask you to cancel this registration, show me the event, its date, the person and the booking id, tell me it runs at once, emails them when Amelia's email is set up and can't be undone here, and wait for my yes. If the event has already started, tell me and stop. Then run amelia/cancel-booking once with that bookingId and type event, always with type event: without it Amelia answered with an error on our test site but cancelled the registration anyway, without emailing the person. Afterwards run amelia/list-events with the event's search and dates and confirm spotsSold went down by the booking's number of people.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Register Someone for an Amelia Class or Event with AI” recipe from the WPVibe cookbook on my connected site.

Someone asks you to put them on the list for a class or a workshop, or to add a friend. You have to check there’s room, that they aren’t already booked and that they’re on file before you enter it by hand.

The AI finds the event in Amelia and checks it is still open, with places left for everyone in the booking. Amelia’s ability itself doesn’t stop at the limit: on our test site a workshop with three places took a fourth person. It finds or adds the person after you check their details, shows you the booking and waits for your yes. Then it books them and checks the places went down.

Booking runs at once and Amelia emails the person when its email is set up. Keep the booking id the AI gives you: it is the only way to cancel this registration from the AI later, as the event list doesn’t show who is booked. Hidden events can’t be found this way. To set up a new class, use this recipe.

Outcome

The person is booked on the event with the places checked before and after, and you have the booking id.