# RSVP Backend Setup

1. Update `config/config.php` with the production MySQL and SMTP details.
   You can also set these environment variables instead:
   `RSVP_DB_HOST`, `RSVP_DB_NAME`, `RSVP_DB_USER`, `RSVP_DB_PASS`,
   `RSVP_SMTP_HOST`, `RSVP_SMTP_USER`, `RSVP_SMTP_PASS`, `RSVP_SMTP_PORT`,
   `RSVP_SMTP_ENCRYPTION`, `RSVP_FROM_EMAIL`, `RSVP_FROM_NAME`, `RSVP_REPLY_TO`,
   `RSVP_ADMIN_USER`, and `RSVP_ADMIN_PASS`.

2. Install PHPMailer:
   ```bash
   composer install
   ```

3. Create the database table:
   ```bash
   php install.php
   ```

4. Serve the production page from a PHP-capable server. The RSVP form in
   `KA60-RSVP.html` submits by AJAX to `api/rsvp.php`.

5. View RSVP responses at:
   ```text
   /admin/
   ```
   Change the default admin password in `config/config.php` or set
   `RSVP_ADMIN_PASS` before going live.

New RSVP submissions send the guest confirmation email and a notification to
`jamesperry080@gmail.com`.

Duplicate protection is enforced by a unique `(event_id, email)` key in
`rsvp_responses`. Guests who submit twice receive a friendly message and no
second database row is created.
