예제 #1
0
        /// <summary>
        /// Sets a new generated password for specified user and sends e-mail notification.
        /// </summary>
        /// <param name="userId">Id of the user</param>
        public void ResetPassword(int userId)
        {
            var user = this.usersFacade.GetUserById(userId);
            string newPass = this.usersFacade.ResetPassword(userId, user.UserName);

            MailSender mailer = new MailSender();
            mailer.Send(user.Email, "New password", "Your new Pass is  " + newPass);
        }
예제 #2
0
 public void ConfirmUserWithReader(int userId, int readerId, string role)
 {
         UserProfileBusinessModel userProfileBusinessModel = usersFacade.SetRoleToUser(userId, role);
         usersFacade.UpdateUserProfile(userProfileBusinessModel);
         ReaderBusinessModel readerBusinessModel = BindUserWithReader(userId, readerId);
         this.readerManager.UpdateReader(readerBusinessModel);
         MailSender mailer = new MailSender();
         string text = "Congradulations! You are successfully registered in the SchoolLibrary. Your user name is " +
                       userProfileBusinessModel.UserName + ". You are confirmed to reader " +
                       readerBusinessModel.FirstName + " " + readerBusinessModel.LastName;
         mailer.Send(readerBusinessModel.EMail, "Confirmation", text);
 }
        public void SendEmailToUser(EmailMassageModel emailMassageModel)
        {
            MailSender mailSender = new MailSender();
            mailSender.Send(emailMassageModel.Email, emailMassageModel.Subject, emailMassageModel.Message);


        }