Skip to content

CampTix: Help buyers recover claim links and clarify status labels - #1722

Open
wputasic wants to merge 6 commits into
WordPress:productionfrom
wputasic:camptix/issue-1721-claim-link-recovery
Open

wputasic wants to merge 6 commits into
WordPress:productionfrom
wputasic:camptix/issue-1721-claim-link-recovery

Conversation

@wputasic

@wputasic wputasic commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1721.

Summary

  • Adds an "Email me my claim links" button on the buyer's ticket-overview page that re-sends the claim email for every Unconfirmed/Unknown ticket in the order, rate-limited to one resend per ticket per hour. Reuses the existing email_attendee_ticket_multiple_template() pipeline so the Unknown→buyer redirect already implemented by redirect_unknown_attendee_emails_to_buyer() applies unchanged.
  • Adds a per-row Copy claim link button on each unclaimed ticket row.
  • Replaces buyer-facing status labels: Unconfirmed → "Awaiting attendee", Unknown → "Awaiting assignment". Applied to the buyer overview, the admin Username column, and the attendee metabox. On the buyer side, a small (?) toggle next to the status opens a note confirming the ticket is fully paid for (a native <details> disclosure, so it works with a keyboard, screen readers and touch).

Internal placeholder constants (UNCONFIRMED_USERNAME, UNKNOWN_ATTENDEE_EMAIL) and all stored database values are unchanged — this is a display + new-UX change only.

Implementation notes

  • All PHP changes live in addons/require-login.php. Every hook used (template_redirect, camptix_notices, camptix_edit_info_cell_content, camptix_attendee_report_column_value_username, camptix_metabox_attendee_info_additional_rows) already exists — no edits needed in camptix.php core.
  • Buyer-facing notice masks recipient addresses (j***@e****.com).
  • The resend walks the whole order in batches of 200, like CampTix_Plugin::form_access_tickets(), so orders with more than 200 tickets are covered.
  • Rate-limit transients (camptix_rl_resend_<attendee_id>) auto-expire after 1 hour; a separate 5-minute transient holds the result summary across the post-submit redirect.
  • Front-end JS/CSS are appended to the existing enqueued files (camptix.js, camptix.css, admin.css) rather than inlined.

Test plan

Automated: three tests in tests/addons/test-require-login.php cover the resend paging past 200 tickets, the escaped status label and the help disclosure markup.

  • Order with no unclaimed tickets — no resend button rendered; status pill shows "Confirmed" for all rows.
  • Order with mixed Unconfirmed + Unknown tickets — resend button visible; each row shows "Awaiting attendee" / "Awaiting assignment" + a Copy claim link button.
  • First click on "Email me my claim links" — emails sent to each attendee/buyer as appropriate; success notice lists masked addresses.
  • Second click within 1 hour — all tickets reported as throttled; no duplicate emails.
  • Click, tap, or press Enter on the (?) next to an unclaimed status — the help note opens and closes.
  • Click "Copy claim link" — clipboard contains the same URL the email contains; button briefly shows "Copied!".
  • Admin > CampTix > Attendees row with [[ unconfirmed ]] — Username column renders "Awaiting attendee" pill with raw constant alongside.
  • Admin metabox on a tix_attendee with the unknown email — Username row renders "Awaiting assignment" pill.
  • Form submitted with missing/invalid nonce — silently ignored, no email sent, no transient set, buyer remains on the access_tickets page.
  • Form submitted with invalid tix_access_token — silently ignored.

Out of scope

The following items from the original issue discussion are intentionally not included here and can be tracked in follow-up issues:

  • Organiser-side bulk-resend admin action
  • Rewrite of the original send-time email templates
  • Scheduled reminder cron for tickets still unclaimed close to the event
  • Login-page interstitial copy changes

Copilot AI review requested due to automatic review settings May 15, 2026 10:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the CampTix buyer ticket-overview UX by adding self-service claim-link recovery (resend + copy controls) and by renaming buyer-facing “Unconfirmed/Unknown” status labels to clearer “Awaiting attendee/Awaiting assignment” labels, while keeping the underlying placeholder constants and stored values unchanged.

Changes:

  • Adds a buyer-side “Email me my claim links” action with per-ticket rate limiting and a post-redirect results notice.
  • Adds a per-row “Copy claim link” button for unclaimed tickets (JS + styling).
  • Updates buyer/admin display of Unconfirmed/Unknown statuses to clearer labels (including tooltip help text and admin pill styling).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
public_html/wp-content/plugins/camptix/addons/require-login.php Adds resend-processing + UI rendering, adds per-row copy button markup, and changes status label rendering for buyer/admin contexts.
public_html/wp-content/plugins/camptix/camptix.js Implements the claim-link copy-to-clipboard behavior with a prompt fallback.
public_html/wp-content/plugins/camptix/camptix.css Styles the resend UI, status help icon, and copy button on the buyer-facing tickets page.
public_html/wp-content/plugins/camptix/admin.css Styles admin-facing “status pill” formatting for username/status displays.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread public_html/wp-content/plugins/camptix/addons/require-login.php Outdated
Comment thread public_html/wp-content/plugins/camptix/addons/require-login.php
Comment thread public_html/wp-content/plugins/camptix/camptix.js Outdated
Comment thread public_html/wp-content/plugins/camptix/camptix.css Outdated
Comment thread public_html/wp-content/plugins/camptix/admin.css
Comment thread public_html/wp-content/plugins/camptix/addons/require-login.php Outdated
wputasic added a commit to wputasic/wordcamp.org that referenced this pull request May 15, 2026
- Username export filter: return plain text instead of HTML so CSV/XML
  reports don't embed <span>/<code> markup. format_admin_username_display()
  now takes a $context arg ('html' for admin UI, 'text' for exports).
- Resend claim links: wrap the email-send loop in
  remove_all_shortcodes() + camptix_init_email_templates_shortcodes
  so the email body renders the [ticket_url]/[buyer_full_name]
  placeholders, matching the core email_attendees() pipeline.
- Copy-claim-link button: stash the button's label in
  data-original-label so rapid clicks don't permanently leave the
  button reading "Copied!".
- camptix.css / admin.css: move new front-end and admin rules above
  the "RTL Styles must be at EOF" block, and add .rtl overrides for
  border-left and margin-left so claim-link UI lines up in RTL.
- Resend help text: reword to cover both Unconfirmed and Unknown
  tickets, since the handler re-sends for both.
Copilot AI review requested due to automatic review settings May 15, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread public_html/wp-content/plugins/camptix/addons/require-login.php Outdated
Comment thread public_html/wp-content/plugins/camptix/addons/require-login.php Outdated
Comment thread public_html/wp-content/plugins/camptix/addons/require-login.php Outdated
Comment thread public_html/wp-content/plugins/camptix/camptix.css Outdated
Comment thread public_html/wp-content/plugins/camptix/admin.css
Addresses WordPress#1721. Buyers landing on the access_tickets
overview now have a way to self-recover when claim emails are lost, and the
"Unconfirmed" / "Unknown" status text — routinely misread as a payment problem
— is replaced with buyer-friendly labels on every surface the buyer or
organiser sees.

Changes:

- New "Email me my claim links" form on the ticket overview, rendered via the
  existing camptix_notices action. Re-sends the multiple-purchase email for
  every Unconfirmed/Unknown ticket in the order, reusing
  email_attendee_ticket_multiple_template() so the Unknown→buyer redirect
  already implemented by redirect_unknown_attendee_emails_to_buyer() applies.
- Per-row "Copy claim link" button on each unclaimed ticket row.
- Rate-limit of one resend per ticket per hour via transient
  camptix_rl_resend_<attendee_id>; result summary stashed in a 5-minute
  transient keyed by access token so the post-redirect GET can render the
  notice. Buyer-facing notice lists masked addresses (j***@e****.com).
- Status text rename: "Unconfirmed" → "Awaiting attendee", "Unknown" →
  "Awaiting assignment". Applied to the buyer overview, the admin Username
  column, and the attendee metabox. Help tooltip on the buyer side confirms
  the ticket is paid.

Internal placeholder constants (UNCONFIRMED_USERNAME, UNKNOWN_ATTENDEE_EMAIL)
and stored database values are not changed — this is a display + new-UX
change only.

Assets land in the existing enqueued files rather than inline:
- Front-end JS: appended to camptix.js (jQuery IIFE, picks up i18n strings
  from data-* attributes set in PHP).
- Front-end CSS: appended to camptix.css.
- Admin status-pill CSS: appended to admin.css.
- Username export filter: return plain text instead of HTML so CSV/XML
  reports don't embed <span>/<code> markup. format_admin_username_display()
  now takes a $context arg ('html' for admin UI, 'text' for exports).
- Resend claim links: wrap the email-send loop in
  remove_all_shortcodes() + camptix_init_email_templates_shortcodes
  so the email body renders the [ticket_url]/[buyer_full_name]
  placeholders, matching the core email_attendees() pipeline.
- Copy-claim-link button: stash the button's label in
  data-original-label so rapid clicks don't permanently leave the
  button reading "Copied!".
- camptix.css / admin.css: move new front-end and admin rules above
  the "RTL Styles must be at EOF" block, and add .rtl overrides for
  border-left and margin-left so claim-link UI lines up in RTL.
- Resend help text: reword to cover both Unconfirmed and Unknown
  tickets, since the handler re-sends for both.
The resend path saves $shortcode_tags, calls remove_all_shortcodes() so the
email template renders with only the email-template shortcodes registered, and
then restores the saved array -- the same remove/restore dance CampTix core
performs in CampTix_Plugin::restore_shortcodes(). Core's own restore is a plain
assignment too, but those lines predate the changed-lines phpcs gate, whereas
this one is new, so GlobalVariablesOverride flagged it and failed the build.

restore_shortcodes() is protected, so the add-on cannot reuse it. Annotate the
assignment instead, with the reason and the core precedent.
@wputasic
wputasic force-pushed the camptix/issue-1721-claim-link-recovery branch from f1143c6 to f209808 Compare September 1, 2026 15:42
- Resend claim links: fetch the order's attendees in batches of 200 until
  none are left, like CampTix_Plugin::form_access_tickets(), instead of
  stopping at the first 200.
- Buyer-facing status label: escape the translated string with
  esc_html_x() before adding the &nbsp; entities.
- Status help: replace the focusable <span> with a title tooltip by a
  native <details>/<summary> disclosure, which works with a keyboard,
  screen readers and touch without JavaScript.
- camptix.css / admin.css: write the new rules as multi-line blocks like
  the rest of each file. The RTL overrides stay on one line to match the
  existing RTL section.

Adds tests to the Require Login addon suite for the paging, the escaping
and the disclosure markup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CampTix: Help buyers recover claim links and clarify Unconfirmed/Unknown labels

2 participants