Skip to content

Five for the Future: Let contributors join a pledge through a private link - #416

Merged
obenland merged 4 commits into
productionfrom
add/pledge-join-link
Oct 2, 2026
Merged

obenland merged 4 commits into
productionfrom
add/pledge-join-link

Conversation

@obenland

@obenland obenland commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #350.

Only the pledge admin can add contributors today, which becomes a bottleneck for larger companies. This adds a private join link that admins can share with their contributors.

How it works

  • Admin: the manage page shows a read-only Join link under Contributors once the pledge is published, along with a Reset link button that stops the current link from working.
  • Contributor: opening the link while logged in adds a pending invitation, which then shows up on My Pledges with the usual Join / Decline buttons. Joining still requires an explicit click and a filled-in profile, and it's recorded in the pledge log.
  • Logged out: the login link on My Pledges now carries the link along, so contributors land on the invitation right after logging in.

To address the spam concern raised in the issue: a link alone never confirms anyone. The contributor still has to accept, the admin can remove people from the Unconfirmed list, and the link can be reset.

Details

  • The key is a random 20-character letters-and-digits string stored in pledge meta (5ftf_join-key). It's created the first time the link is shown and compared with hash_equals(). It only works for its own published pledge.
  • Anyone who already has a contributor post for the pledge, including a trashed one, is skipped. People who were removed, declined, or left can't put themselves back through the link; only the admin can re-invite them. Trashed posts are emptied after 30 days by default, so this block lasts that long.
  • Reset uses its own form, so unsaved pledge edits aren't submitted with it, and it's recorded in the pledge log.
  • This is wired into both the classic theme's shortcode and the 2024 theme's my-pledge-list block.

Testing

  • npm run test:php -- --group contributor: the new test covers link stability, a wrong key, a key used on another pledge, a reset, and a deactivated pledge. A second test covers inviting once and a removed contributor not being able to rejoin.
  • Manual: open a published pledge's manage page, copy the join link, open it as another logged-in user, and confirm the pending card appears and Join works. Then reset the link and check that the old URL no longer adds an invitation.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 2, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

obenland and others added 4 commits October 2, 2026 15:26
… link

Pledge admins get a join link on the manage page to share with their
contributors. Opening it while logged in adds a pending invitation that
the contributor confirms on My Pledges, like any other. Logging in from
the link keeps it intact, and admins can reset the link if it reaches the
wrong people.

Fixes #350.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Don't let removed, declined, or departed contributors rejoin through the
  link; only the pledge admin can add them back.
- Reset the link from its own form, so unsaved pledge edits aren't carried
  along, and log resets.
- Create the key without overwriting a concurrent one, and build the link
  from the My Pledges permalink.
- Look up contributors by login, which is what callers pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@obenland
obenland force-pushed the add/pledge-join-link branch from d49edab to 1733b32 Compare October 2, 2026 20:27
@obenland
obenland merged commit f1aaf2f into production Oct 2, 2026
2 checks passed
@obenland
obenland deleted the add/pledge-join-link branch October 2, 2026 20:30
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.

Companies should have a private url / password-url to invite members to their company

2 participants