If you know SQL, you can do this sort of custom reporting ("get the email addresses of all enrolled students who ...") using https://moodle.org/plugins/report_customsql (or the configurable reports block).
If you know SQL, you can do this sort of custom reporting ("get the email addresses of all enrolled students who ...") using https://moodle.org/plugins/report_customsql (or the configurable reports block).