Automatically add new member to Member Group on registration in Umbraco 8
Hi all,
Using Umbraco 8.5, I've created an area in my members backend where I'm going to allow selected "admin" members to register new members.
Only catch is I need to also automatically have those new members added to the admin's own member group(s) on registration.
I've searched through the forums and can't find any detailed instructions on how to set up the classes/models in Umbraco 8 I'd need and how to implement them (relatively new to MVC and brand new to the concept of the Umbraco Composer & Components so having a hard time wrapping my brain around it).
I'm using the default "Register Member" snippet for the registration.
The "out of the box" CreateRegistrationModel is great, however it only allows me to customise the newly registered members alias, not their Member Group.
The logic I've thought of is to find the current member groups of the "admin" user when signed into the registration page using "Members.GetCurrentUserRoles();" and use that value to somehow assign it to the newly registered member.
Hi there. Sadly, no. I hadn't figured a solution for this before the pandemic hit... :-/ Just back working now though and will get to look at it again. Will post again if a solution is found..
How we wanted it is anyone who signed up with @companyname.net got put into an approve group, anyone who signed up without @companyname.net email would be put in the review group.
Not quite what your after but hopefully helps in some way.
Automatically add new member to Member Group on registration in Umbraco 8
Hi all, Using Umbraco 8.5, I've created an area in my members backend where I'm going to allow selected "admin" members to register new members.
Only catch is I need to also automatically have those new members added to the admin's own member group(s) on registration.
I've searched through the forums and can't find any detailed instructions on how to set up the classes/models in Umbraco 8 I'd need and how to implement them (relatively new to MVC and brand new to the concept of the Umbraco Composer & Components so having a hard time wrapping my brain around it).
I'm using the default "Register Member" snippet for the registration.
The "out of the box" CreateRegistrationModel is great, however it only allows me to customise the newly registered members alias, not their Member Group.
The logic I've thought of is to find the current member groups of the "admin" user when signed into the registration page using "Members.GetCurrentUserRoles();" and use that value to somehow assign it to the newly registered member.
Any thoughts?
Hi Andrew,
Did you manage to work this out? I have a similar issue and so far have drawn a blank.
many thanks
Nick
Hi there. Sadly, no. I hadn't figured a solution for this before the pandemic hit... :-/ Just back working now though and will get to look at it again. Will post again if a solution is found..
Hello,
Not sure if this helps but I have this on Umbraco 8
I have a controller called RegisterMemberController.cs which I beleive is just the default, then added the following at the bottom;
How we wanted it is anyone who signed up with @companyname.net got put into an approve group, anyone who signed up without @companyname.net email would be put in the review group.
Not quite what your after but hopefully helps in some way.
@Nik thanks again for your help with this.
Thanks
is working on a reply...