alright this should help

It looks like a lot of changes but mostly its just changing the indents and moving some code around

https://github.com/mantisbt-plugins/EmailReporting/commit/9de7be5904bce004498846e856482ce87a712fa3

Now you can use: get_userid_from_email