I'm working on a custom module for DNN 3.3.7. There are about 1500 registered users on my site, divided up amongst about 50 roles.
We'd like to let users retrieve a list of all other users sharing their role ID and then email all the users within that role. For example, Joe Smith is in the programmers role. We'd like him to be able to retrieve contact info for all the other programmers and send them an email.
I'm trying to figure out the best way to retrieve all the users within a role. I have a custom member management module I purchased that appears to be calling Membership.GetAllUsers(), and then filtering manually in code. Within 1500 users, this ends up being really slow with a separate database query for every user.
Is it appropriate to just write a new stored procedure in my custom module that searches on Role ID? Is this method likely to break in upcoming DNN upgrades?
I'm relatively new with module development, so any hints would be appreciated.
Thanks, Frank