Exemplo n.º 1
0
        public IHttpActionResult RouterEmailPush([FromUri] string emailAddress)
        {
            //this method takes an email address. Checks if minimum data exists. Then
            //if it doesn't it returns a flag to collect more data.
            //if minumum data does exist it creates a new router user and redirects them ot
            //the daily surveys page
            var _manager = new RouterManager();
            MinimumInfoExistsResult minimumInfoExistsResult = _manager.CheckIfMinimumInfoExistsForEmail(emailAddress);

            if (minimumInfoExistsResult.HasMinimumInfo && !minimumInfoExistsResult.HasRounterContact)
            {
                RouterContact user = _manager.RouterContactFullSetup(emailAddress);
                minimumInfoExistsResult.HasRounterContact     = true;
                minimumInfoExistsResult.RouterContactUniqueId = user.UniqueId;
            }

            return(Ok(minimumInfoExistsResult));
        }