I am trying to add users from Wordpress to private groups in Discourse via webhook.
I use WP Discourse plugin as a SSO login method and I don’t allow users to change their username in Discourse. I made this because I thought that this way I could use the username from Wordpress to add them to a group in Discourse. Because, I thought they would be the same.
The problem is that when the username is generated automatically in Wordpress, sometimes uses their email as their username. But Discourse doesn’t allow this in usernames, so it breaks the username at “@”.
Wordpress email: email@example.com
Wordpress username (generated automatically): firstname.lastname@example.org
Discourse username (generated through WP Discourse SSO): jhon
This is not allowing me to use the wordpress user to add them to a group.
Is there an easier way to make this?
It would be awesome to be able to add users to a group with their email instead of username. The email is always available in any app (CRM, Wordpress, etc), so it won’t be needed the extra step to make a “GET” request to the API to get the username from that email and then PUT them in the group.
I use Fluent Forms to send this data to the webhook from Wordpress when they send a form, so I can’t make the GET request and then PUT the username.