Link Guest Tickets to User Accounts

Understand how matching registered WordPress email addresses can associate unlinked guest tickets with user accounts, and test the flow safely.

Dragwyb Click to Chat can associate eligible guest tickets with a registered WordPress account when the account’s registered email address matches the email stored on an unlinked guest ticket. The inspected version performs this association during account registration and ticket retrieval flows; this is not documented as a separate manual “claim ticket” button.

How automatic account linking works

When a guest ticket is created, it can be stored without a WordPress user ID. The ticket service can later find unlinked guest tickets whose customer email matches the registered WordPress user’s email, then associate those tickets with that user. The code obtains the email from the WordPress user record for the linking operation rather than trusting an arbitrary email supplied by a visitor.

Linking can run when a new user registers and during ticket retrieval. The implementation also allows authorized staff or administrators to trigger linking for a selected account through supported ticket-query flows. The exact tickets associated depend on the saved ticket email and account email at the time the linking routine runs.

Test with a controlled account

  1. Create a test guest ticket using a dedicated email address that you control.
  2. Register or sign in to a dedicated WordPress test account whose registered email exactly matches that ticket email.
  3. Open the intended ticket or ticket list to exercise the account retrieval flow.
  4. Verify that the expected ticket is associated with the test account and appears in its permitted ticket view.
  5. Repeat with a different test account whose registered email does not match. Confirm that it cannot access the first account’s ticket.

Do not test account linking by using a real customer’s address or ticket. If a ticket does not link, compare the saved guest ticket email with the account’s registered WordPress email and check whether the ticket is already associated with a user.

Common reasons a guest ticket is not linked

  • Email mismatch: the address used on the guest ticket differs from the account’s registered email.
  • The ticket is already linked: the automatic routine targets tickets with no associated WordPress user ID.
  • The linking flow has not run yet: in the inspected implementation, linking occurs on registration and during relevant ticket retrieval flows.
  • Unexpected account access: test with separate accounts and review the ticket’s stored customer email and user association through authorized administrative tools.

Privacy and access considerations

Account linking is not a substitute for ticket-level authorization. The portal still checks the logged-in user’s relationship to a ticket or the guest token when authorizing access to a specific ticket. Do not assume that knowing a ticket ID or entering an email address alone should grant access.

For the related setup, read Guest Ticket Access and Privacy, Configure Secure Guest Ticket Access, and Protect Customer Conversations.