Esempio n. 1
0
        public string GanerateAndSendOTP(string email)
        {
            Random random = new Random(DateTime.Now.Second);

            int otp = random.Next(1111, 9999);

            string encryptedOtp = _dataProtector.Protect(otp);

            string body = "Dear " + _tokenDecoder.UserName + ", <br /><br />" + "Kindly enter below number as OTP for your account activities.<br />OTP: " + otp.ToString() + "<br /><br />Greetings,<br />Parking Booking System.";

            _client.SendEmail(email, _tokenDecoder.UserName, "OTP for change password", body);

            return(encryptedOtp);
        }
 public bool SendEmail(IMailClient mailClient)
 {
     return(mailClient.SendEmail(this.From, this.To, this.Subject, this.Body));
 }