RSVP

An event sign-up with a seat limit, a waitlist when it is full, and an email to the host for every reply.

Common meetup

Thursday 5 November, 6:30 pm · The back room at Café Lune

6 of 12 seats left.

Coming

  • Ada +1
  • Grace +2
  • Alan

Waitlist

Nobody is waiting.

Seat or waitlist
set taken to taken of first of ask database "select coalesce(sum(guests), 0) as taken from rsvps where waitlist = 0"

set waitlist to 0
if taken + guests is more than seats
  set waitlist to 1
end
tell database "insert into rsvps (name, email, guests, waitlist, joined) values (?, ?, ?, ?, ?)" with name, email, guests, waitlist, now

send email to site_email
  subject: "RSVP: [name] ([guests_text])"
  reply to: email
  from: site_from
  body: "[name] ([email]) is coming to [event_name]."
end
go to "/rsvp?done=yes"

Names are shown to everyone, email addresses never are: the page only asks the database for the columns it shows.