Closed Jon007 closed 7 years ago
When sending an invite by email, can we add mandatory XProfile field values to the invite?
If all you want to do is stage some XProfile information (and other data like Member Type affiliation), then you could write a secondary plugin that hooks into the front-end interface (somewhere like invite_anyone_addl_fields
), saves submitted values along with the invitation, and then processes the additional data at the time that invitations are accepted (accepted_email_invite
is a good hook for this).
In fact can we pre-Save the user in Pending status
This is quite a bit more complicated. It changes the semantics of the plugin: you're no longer "inviting" users, but instead you are "adding provisional users" or something like that. From the Invite Anyone point of view, you probably wouldn't want anything but the front-end: you'd need to bypass all of the send-invites logic, and there's not much point to saving invitations in the database if they're all going to be auto-accepted.
That said, you could build this, but it'd be complicated. In non-Multisite, user accounts are created at the time of registration, and are left in a pending status until the user activates. This is pretty close to what you're asking for. In Multisite, users are not created until activation. And BuddyPress has its own compatibilty layer, so that the separation between signups and users is maintained even when not using Multisite. As you suggest, it's necessary to have a user account to do things like save XProfile data and create group memberships. So if you wanted to do these things before activation, you'd need to bypass the BP system.
I'd be wary of introducing this kind of functionality to Invite Anyone itself. Not that I can't see the use case - it's a compelling way to onboard users in bulk in environments like a school. But it's too dissimilar from the way Invite Anyone currently works. Your suggestion sorta assumes that there is a class of users with the ability to add new (albeit non-activated) users to the system. IA is intended for a broader subset of BP instances, where it's assumed that regular users should have limited permissions to do things like create users. That's why the emphasis is on invitation, rather than importing or something like that.
I'd be happy to chat more if you'd like some more thoughts on how I would implement your ideas as a standalone project, but I don't think it's viable for Invite Anyone.
thanks very much for your thoughts! Yes it would be preferable to save the information to the real tables but I don't have the sponsorship for a separate component, I'll give it some more thought.
When sending an invite by email, can we add mandatory XProfile field values to the invite? In fact can we pre-Save the user in Pending status, with all the group memberships already set up and just send an activation email? (like a password reset email, so the user only needs to reset the password to access).
This will also help with the situation that the invitation emails are not received, new emails can be generated with standard password reset function and other tools already in the system.
Example use case: with each email invite we need to specify values for mandatory fields eg:
The user is not allowed to change these fields, especially if they are a student, nor is it intended that the user can reject or simply not click on the various group invitations etc, it would be most convenient to direct add the invited groups and direct add friendship to the inviter, so the teacher doesn't have to go round the class ensuring everyone has accepted the invites (that may be even worse for a virtual class than a physical one).
Then the group manager would be able to see in the group that the members are already created, even if they are pending activation: whereas at the moment when looking at a group it is not possible to see who is already invited by email.