=== Attendarra ===
Contributors: diane99
Tags: seminar, registration, events, waitlist, calendly
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Seat-limited seminar registration with waitlisting, reminders, CSV export, calendar downloads, and optional Calendly scheduling.

== Description ==

Attendarra turns any WordPress post type into a seat-limited event registration form. Attendees fill out a short form, are automatically confirmed or placed on a waitlist depending on seat availability, and — if a Calendly link is configured — are handed straight to a Calendly scheduler to pick their time slot.

**Registration and waitlisting**

* Seat-limited registration with automatic waitlisting once a seminar is full.
* Automatic waitlist promotion: when a confirmed registrant cancels or is removed, the oldest fitting waitlisted registration is promoted automatically (seat, Calendly link, and email notification included), oldest first.
* Optional "bring a guest" field with a configurable max seats per registration.
* Configurable extra fields per seminar (e.g. "Company", "Job title") that appear as extra text inputs on the form and are stored per registration.
* Built-in honeypot spam protection — no CAPTCHA, no extra dependency, invisible to real visitors.

**Scheduling and reminders**

* Built-in Calendly integration: embed a public scheduling link, or generate single-use scheduling links via the Calendly API. Entirely optional — leave it blank and the form works as a plain RSVP.
* Optional seminar date/time field. When set, it powers automatic reminder emails (configurable hours before the seminar) and a downloadable .ics calendar file offered to confirmed registrants.

**Self-service and admin tools**

* `[atdra_seminar_my_registrations]` shortcode lets attendees look up their own registrations by email and cancel them without contacting an admin (cancelling frees the seat and triggers waitlist promotion).
* Admin dashboard for registrations (update status, bulk remove, one-click CSV export) and a separate participants archive that keeps contact history even after a registration is removed, with its own CSV export.
* A Gutenberg block ("Seminar Registration Form") lets editors pick a seminar from a dropdown instead of typing the shortcode by hand.
* Configurable confirmation, waitlist, and consent messages per seminar.
* Email notifications to the admin and the registrant on every submission, promotion, and reminder.

**Design**

* Choose from 5 built-in color palettes (violet, blue, green, amber, slate), or enter your own custom hex colors — set a site-wide default and override it per seminar.

**Privacy**

* Built-in support for the WordPress personal data export and erasure tools.
* Data (custom database tables, seminars, and settings) is kept by default when the plugin is deleted; a setting lets you opt into full cleanup on uninstall instead.

Calendly modes:

* Public link mode — embeds your existing Calendly link after a confirmed registration.
* Single-use mode — requires a Calendly Personal Access Token and an Event Type URI, and creates a fresh one-time scheduling link per registrant.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/attendarra`, or install it through the Plugins screen in WordPress directly.
2. Activate the plugin through the 'Plugins' screen.
3. Go to Seminars > Settings to set an admin notification email, choose a default color palette, and (optionally) add a Calendly Personal Access Token for single-use links.
4. Go to Seminars > Add New Seminar and fill in the seminar details: maximum seats, maximum guests, seminar date/time (optional, enables reminders and calendar downloads), extra fields (optional), and Calendly link (optional).
5. Add the form to a page either by pasting the shortcode shown in the "Shortcode" box on the seminar edit screen (`[atdra_seminar_registration id="123"]`), or by adding the "Seminar Registration Form" block in the block editor and picking the seminar from the dropdown.
6. Optionally add `[atdra_seminar_my_registrations]` to a page so attendees can look up and cancel their own registrations.

== Frequently Asked Questions ==

= Do I need a Calendly account? =

No. Leave the Calendly public link field empty and the form works as a standalone seat-limited registration form with no scheduling step.

= What's the difference between "Registrations" and "Participants"? =

Registrations are the active, per-seminar sign-ups shown under Seminars > Registrations; removing one here clears it from that seminar's active list. Participants is a running contact archive (kept under Seminars > Participants) that survives registration removal, so you keep a history of who has attended before. Participant records can be permanently deleted independently.

= How does waitlist promotion work? =

When a confirmed registration is cancelled, removed, or its status is changed away from "Confirmed," the plugin checks the seminar's waitlist in order (oldest first) and promotes the first registration that now fits in the freed-up seats. A Calendly link (if configured) is generated and an email is sent automatically. If the next waitlisted registration needs more seats than are available, promotion stops there rather than skipping ahead to a smaller party, to keep the waitlist fair and in order.

= How do reminder emails work? =

Set a seminar date/time and a "hours before" value on the seminar edit screen. A background task (WP-Cron) checks hourly and emails each confirmed registrant once they cross that threshold, as long as the seminar hasn't started yet. Reminders are skipped entirely for seminars with no date/time set.

= How do attendees add the seminar to their calendar? =

If a seminar has a date/time set, confirmed registrants get an "Add to calendar" (.ics) download link in their confirmation message and email.

= How do I let attendees cancel their own registration? =

Add `[atdra_seminar_my_registrations]` to any page. Visitors enter the email they registered with, see their registrations, and can cancel any that are still pending, waitlisted, or confirmed.

= How do I change the color scheme? =

Go to Seminars > Settings and pick one of the 5 built-in palettes, or choose "Custom" and enter your own hex colors. Each seminar can also override the site-wide default from its own edit screen.

= Does this support GDPR-style data requests? =

Yes. Registration and participant records are included in WordPress's built-in personal data export and erase tools (Tools > Export/Erase Personal Data).

= What happens to my data if I delete the plugin? =

By default, nothing is deleted — your seminars, registrations, and settings remain in the database so you can safely reinstall. If you want a full cleanup on deletion, check "Delete all seminars, registrations, participants, and settings when this plugin is deleted" on the Settings page before removing the plugin.

== External services ==

This plugin can optionally connect to Calendly, a third-party scheduling service, to let confirmed registrants pick a time slot. Calendly is only contacted if a site owner configures a Calendly link on a seminar; if left blank, the plugin works as a standalone registration form with no external connections at all.

* **Calendly scheduling widget (public link mode):** if a seminar has a public Calendly link configured, the plugin loads Calendly's widget script (`https://assets.calendly.com/assets/external/widget.js`) in the confirmed registrant's browser to display the embedded scheduler. The registrant's name and email, as entered on the registration form, are sent to Calendly to pre-fill the scheduling widget.
  Calendly's terms of service: https://calendly.com/legal/customer-terms-conditions
  Calendly's privacy policy: https://calendly.com/legal/privacy-notice

* **Calendly Scheduling Links API (single-use mode, opt-in):** if a site owner enters their own Calendly Personal Access Token and Event Type URI to enable single-use scheduling links, the plugin's server sends that Event Type URI to Calendly's API (`https://api.calendly.com/scheduling_links`), authenticated with the site owner's token, to generate a one-time booking link for each confirmed registrant. This request happens only when single-use mode is enabled; no registrant personal data is included in this particular request.
  Calendly's terms of service: https://calendly.com/legal/customer-terms-conditions
  Calendly's privacy policy: https://calendly.com/legal/privacy-notice

== Screenshots ==

1. Front-end registration form with the default violet palette.
2. Seminar settings screen, including seat limits, date/time, reminders, extra fields, Calendly configuration, and per-seminar palette override.
3. Registrations list with CSV export, extra-info column, and status management.
4. Participants archive with search and CSV export.
5. The "My Registrations" self-service lookup and cancel shortcode.
6. The Seminar Registration Form block in the editor.

== Changelog ==

= 1.0.1 =
* Renamed the plugin to Attendarra.
* Fixed: the Update/Publish button could stay disabled after editing fields in the Seminar Settings box, because the block editor doesn't detect changes made in classic meta box fields on its own.
* Removed a stray, unreachable action hook left over from development.
* Enqueued two inline admin scripts properly instead of echoing them directly.
* Tightened sanitization on the "delete data on uninstall" setting.
* Documented the Calendly external service in this readme.

= 1.0.0 =
* Initial release: seat-limited registration with automatic waitlisting and waitlist promotion, guest handling, configurable extra fields, honeypot spam protection, optional Calendly integration (public and single-use links), optional seminar date/time with reminder emails and .ics calendar download, self-service "my registrations" lookup and cancellation, a Gutenberg block, registrations/participants admin screens with CSV export, 5 built-in color palettes with custom hex override, GDPR export/erase support, and optional data cleanup on uninstall.
