Get list of invited users

AI 生成的摘要

The discussion revolves around retrieving a list of invited users in Discourse. pfaffman notes that while invites are stored in a separate table, there’s no straightforward way to view all invited users without using Data Explorer. techAPJ suggests a simple Data Explorer query to list invited users, highlighting that appending _user_id allows for proper user display. pfaffman appreciates the tip and confirms the query works. techAPJ updates that required custom fields are now enforced for invites, with a visual demo provided. jimkleiber adds a note that the original query may no longer work, offering an updated version using invited_users and invites tables with proper joins to retrieve invitee and inviter usernames, along with redemption timestamps.

Because required custom fields are not required for invites, a client wants to know who’s been invited. I don’t see an easy way to get that information. I thought that perhaps clicking “invited users” on the admin user page would do that, but it includes just my invites, not all invites.

Is there a way to do this? (Other than data explorer?)

2 个赞

This is a question for @techAPJ

What’s the issue with using data explorer? A simple data explorer query for this will list all the invited users in properly formatted (hyperlinked) UI and the result can be exported as needed.

Here is the data explorer query if you are interested:

SELECT user_id,
       invited_by_id as invited_by_user_id,
       redeemed_at
FROM invites
WHERE redeemed_at IS NOT NULL
ORDER BY redeemed_at DESC
8 个赞

I’d already written a query for data explorer, I was just surprised that there wasn’t a way to do it without the data explorer. Since invites are in their own table, it’s not rocket science to write the query, but your query taught me that I could append _user_id to something to make it use the user displayer thing. That’s cool. Thanks.

7 个赞

Not anymore. :slight_smile:

https://github.com/discourse/discourse/commit/b9c94aa234fb6198a163ca2e990a3e0b209fbf90

Demo:

11 个赞

请注意,这个好像不再起作用了,但是下面的那个对我来说是有效的:

https://meta.discourse.org/t/list-of-users-who-signed-up-via-invitations/224871/6

1 个赞