Refactor getToken
Refactor setAlert
Skip email send if the request came from CLI