I have run into multiple instances where plugins were using get_users_by_capability() when generating a list of users to contact. I have argued that the correct function to use would be get_enrolled_users() instead because this eliminates the inclusion of users with system roles. For instance, questionnaire currently generates a list of users that are "non responders". It does this by getting a list of everyone who has the capability to take the questionnaire and removes the users that already have. However, in this list are all the site admins and managers. Although they have the capability of taking any questionnaire, they aren't the intended audience. This becomes a real issue when the list is anonymous and system users can't be deselected manually from the list.
Another case is a plugin that has student submission emails going to people with the capability to grade. Again, admins and managers receive emails.
I'm pretty sure I'm correct on this, but could I get some validation on when is the appropriate time to use get_users_by_capability() and when is the correct time to use get_enrolled_users()
Thanks!!