public IEnumerable <Employee> Get() { using (EmployeeDBEntities employeeDbEntities = new EmployeeDBEntities()) { DailyMailService mailScheduler = new DailyMailService(); return(employeeDbEntities.Employees?.ToList()); } }
private async Task <string> SendEmailConfirmationTokenAsync(string userID, string subject) { string code = await UserManager.GenerateEmailConfirmationTokenAsync(userID); // var newRouteValues = new RouteValueDictionary(new { userId = userID, code = code }); //newRouteValues.Add("httproute", true); System.Web.Mvc.UrlHelper urlHelper = new System.Web.Mvc.UrlHelper(HttpContext.Current.Request.RequestContext, RouteTable.Routes); string callbackUrl = urlHelper.Action( "ConfirmEmail", "Account", new { userId = userID, code = code }, HttpContext.Current.Request.Url.Scheme ); string emailBody = "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>"; DailyMailService dailyMail = new DailyMailService(); string username = HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(userID).UserName; dailyMail.SendMailWithoutAttachment(username, "*****@*****.**", "confirm Email", emailBody); //await UserManager.SendEmailAsync(userID, subject, //"Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>"); return(callbackUrl); }