refactoring UserController code to use new sendmail plugin from base module