public ActionResult DeleteCertificateHub(string certificateIdentificator, string returnUrl) { if (!string.IsNullOrWhiteSpace(certificateIdentificator)) { var user = _context.userRepository.GetUserByEmail(this.User.Identity.Name); var generatedCode = _keyGenerator.GenerateUserTokenForEntityDeletion(user); var url = Url.DeleteCertificateEntityLink(certificateIdentificator, generatedCode, Request.Scheme); var emailMessage = _emailSender.GenerateEmailMessage(user.Email, user.FirstName + " " + user.LastName, "authorizeAction", url); _emailSender.SendEmailAsync(emailMessage); return(RedirectToAction("UniversalConfirmationPanel", "Account", new { messageNumber = 5, returnUrl })); } return(RedirectToAction("BlankMenu", "Certificates")); }