private void SendEmailToUser(ApplicationUser user, string subject)
        {
            var UserEmails = new string[] { user.Email };
            IEnumerable <ApplicationUser> adminTeam = _userManager.Users.Where(u => u.IsAdmin == true);
            var admins = new List <string>();

            foreach (var admin in adminTeam)
            {
                admins.Add(admin.Email);
            }
            string allAdmins = string.Join(", ", admins);
            string content   = "Hi " + user.UserName + ", thank for being part of our admin team." +
                               " here is the rest of the team members: " + allAdmins + ".";
            var message = new Message(UserEmails, subject, content);

            _emailSender.SendEmail(message);
        }
Example #2
0
        private void SendEmailToUser(ApplicationUser user, string subject)
        {
            var UserEmails = new string[] { user.Email };
            IEnumerable <ApplicationUser> adminTeam = _userManager.Users.Where(u => u.IsAdmin == true);
            var admins = new List <string>();

            foreach (var admin in adminTeam)
            {
                admins.Add(admin.Email);
            }
            string allAdmins = string.Join(", ", admins);
            string content   = "Hi " + user.UserName + ", Someone trying to access your account at " + DateTime.Now + ", " +
                               "the account is locked right now, the end is " + user.LockoutEnd + ". " +
                               "Please contact one of our admins: " + allAdmins + ".";
            var message = new Message(UserEmails, subject, content);

            _emailSender.SendEmail(message);
        }
Example #3
0
        private void SendEmailToUser(ApplicationUser user, string subject)
        {
            var UserEmails = new string[] { user.Email };
            IEnumerable <ApplicationUser> adminTeam = _userManager.Users.Where(u => u.IsAdmin == true);
            var admins = new List <string>();

            foreach (var admin in adminTeam)
            {
                admins.Add(admin.Email);
            }
            string allAdmins = string.Join(", ", admins);
            string content   = "Hi " + user.UserName + ", thank for using Private Note." +
                               " here is our admin team: " + allAdmins + ", " +
                               "you can contact them if you have any question about this application";
            var message = new Message(UserEmails, subject, content);

            _emailSender.SendEmail(message);
        }