Patriot Platform Members 1.03 — Event confirmations and reminders

INSTALL
Back up the database and installed plugin. Upload patriot-platform-1.03.zip in
WordPress > Plugins > Add New > Upload Plugin and replace the current plugin.
This complete package includes 1.01 dashboards and 1.02 event RSVPs.
The next WordPress init upgrades the RSVP table with a registration generation
identifier and creates a separate event email queue. No existing RSVP is deleted.
No reactivation is required. Deactivation clears the email worker schedule.

NEW BEHAVIOUR
- A new registration queues a registration confirmation.
- Cancellation queues a cancellation confirmation.
- A reminder is scheduled approximately 24 hours before the activity.
- Registrations made within 24 hours queue both confirmation and reminder for
  the next worker run. These can arrive close together.
- Changing the event-volunteer checkbox does not send another confirmation.
- Repeat registration/cancellation submissions do not generate duplicate notices.
- Event emails use the WordPress mailer and therefore your existing SMTP setup.
- Plain-text emails include the event name, date/time with its timezone, venue,
  volunteer choice where relevant, and the member-dashboard link.

WHERE TO CHECK
WordPress > Patriot Platform > Event email queue.
Statuses: pending, sending, sent, failed, skipped.
Sent means wp_mail accepted the message; it does not prove inbox delivery.
The queue shows the event/member, type, attempts, UTC due time and last result.
'Process due emails now' runs one batch. Failed messages have a Retry button.
The queue is administrator-only. No public email history is exposed.

SCHEDULING AND RETRIES
WP-Cron checks every five minutes and submits up to 10 due messages per run.
For reliable timing on low-traffic sites, arrange a real server cron for WordPress.
No server cron is installed by this ZIP. Large backlogs can delay reminders.
Mailer failures retry after approximately 5, 10 and then stop at three attempts.
Rows left in sending after a worker interruption are not automatically resent,
since the mailer may already have accepted them. After 30 minutes an administrator
may retry them; this can duplicate a message whose outcome was uncertain.
The administrator action and worker use a shared advisory lock to avoid overlap.

ELIGIBILITY AND EVENT CHANGES
Pending reminders/confirmations are skipped if the registration was cancelled,
its generation changed (cancel/re-register), the event is unpublished or past,
or the member is no longer eligible. Cancellation confirmations can still go
to an inactive member because they acknowledge that member's own cancellation.
If an event time changes, the old reminder is skipped and the rolling scanner
queues a reminder for the revised start once it is within 24 hours. There is no
separate event-reschedule announcement in this release.
Existing pre-upgrade registrations receive reminders when within the reminder
window, but do not receive retrospective registration confirmations.
The rolling scanner examines 100 confirmed RSVP rows per tick, advancing a cursor;
very large membership/event histories may delay a full scan cycle.

FAILURES AND PRIVACY
If enqueueing fails, the administrator queue page shows a persistent warning;
registration itself remains saved. Resolve the database issue before assuming
all notices were queued. No automated guarantee or inbox-delivery tracking exists.
Event/user deletion and WordPress privacy erasure remove queue records. Queue
records retain IDs and status, not stored email bodies or recipient addresses;
the worker resolves the current account email just before sending.
No real emails were sent during development tests.

VALIDATION
19 PHP files passed PHP runtime lint. PHP 8.0 syntax parsing also passed.
43 combined isolated RSVP/email checks passed, with WordPress and database
boundaries stubbed. Covered generation/deduplication, cancellation/eligibility,
rescheduled reminders, retry limits, interrupted sends, lock failure, future due
times and the previous RSVP permission/capacity checks. ZIP integrity checked.
A running WordPress installation, actual database upgrade, real SMTP delivery,
concurrent MySQL workers and browser layout were not tested here.

LIVE TEST CHECKLIST
1. Install on a test site. Confirm no database/schema errors appear in logs.
2. Create a future approved activity using an active member of the right region.
3. Register; verify confirmation/reminder entries in Event email queue.
4. Process due emails and confirm receipt at your own test mailbox.
5. Re-save volunteer choice; verify no duplicate confirmation.
6. Cancel; process queue and confirm the cancellation email. Old reminder skips.
7. Re-register; check only the current-generation reminder is sent.
8. Use an event inside 24 hours; process its reminder and verify event timezone.
9. Change event time and test the rescheduled reminder, unpublished and past cases.
10. Verify failed mailer attempts and manual retry with a controlled test mailer.
11. Confirm your server WP-Cron arrangement and monitor pending queue size.
