Exemplo n.º 1
0
        public async Task <IActionResult> ConfirmEmailAsync([FromBody] RegisterUserViewModel model)
        {
            ApplicationUserViewModel applicationUserView = await _applicationUserService.FindByEmailAsync(model.Email);

            string code1 = await _applicationUserService.GenerateEmailConfirmationTokenAsync(model);

            string callbackUrl = Url.Action(CONFIRM, ACCOUNT, new { userId = applicationUserView.Id, code = code1 }, protocol: Request.Scheme);
            string linkString  = $"<a href = \"{callbackUrl} \"> complete registration </a>";
            var    messageBody = $"{COMPLITE} {linkString}";

            new EmailService().SendEmail(model.Email, MESSAGECONFIRM, messageBody);

            return(Ok(200));
        }