private async Task <string> SendRequestEmail(ComeToOfficeRequestViewModel requestViewModel, MailTemplate mailTemplate)
        {
            string message = "";

            try
            {
                appEmailHelper = new AppEmailHelper();
                var hrEmployeeList = await _employeeRepository.GetEmployeeDetailsByRole(EmployeeRolesEnum.HRManager.ToString());

                if (hrEmployeeList.Count > 0)
                {
                    foreach (var hrEmployee in hrEmployeeList)
                    {
                        appEmailHelper.ToMailAddresses.Add(new MailAddress(hrEmployee.Email, hrEmployee.Name));
                    }
                }
                appEmailHelper.CCMailAddresses.Add(new MailAddress(requestViewModel.Employee.Email, requestViewModel.Employee.Name));
                appEmailHelper.MailTemplate = mailTemplate;
                appEmailHelper.Subject      = "Request for attending Office";
                ComeToOfficeRequestEmailViewModel emailVm = new ComeToOfficeRequestEmailViewModel();
                emailVm.MapFromViewModel(requestViewModel);
                emailVm.LinkUrl = $"{ _configuration["AppUrl"]}requests";
                emailVm.HRName  = "HR";
                appEmailHelper.MailBodyViewModel = emailVm;
                await appEmailHelper.InitMailMessage();
            }
            catch (Exception e)
            {
                message = e.Message;
            }
            return(message);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="requestViewModel"></param>
        /// <param name="mailTemplate"></param>
        private async Task <string> SendResponseEmail(ComeToOfficeRequestViewModel requestViewModel, MailTemplate mailTemplate)
        {
            string message = "";

            try
            {
                appEmailHelper = new AppEmailHelper();

                var activeUserEmailId = ((ClaimsIdentity)_principal.Identity).GetActiveUserEmailId();
                var activeUserName    = ((ClaimsIdentity)_principal.Identity).GetActiveUserName();
                if (!string.IsNullOrEmpty(activeUserEmailId))
                {
                    appEmailHelper.FromMailAddress = new MailAddress(activeUserEmailId, activeUserName ?? "HR");
                }

                appEmailHelper.ToMailAddresses.Add(new MailAddress(requestViewModel.Employee.Email, requestViewModel.Employee.Name));
                appEmailHelper.MailTemplate = mailTemplate;
                ComeToOfficeRequestEmailViewModel emailVm = new ComeToOfficeRequestEmailViewModel();
                emailVm.MapFromViewModel(requestViewModel);
                if (requestViewModel.IsApproved)
                {
                    emailVm.Status         = "Approved";
                    appEmailHelper.Subject = "Your request is approved by HR";
                }
                else if (requestViewModel.IsDeclined)
                {
                    emailVm.Status         = "Declined";
                    appEmailHelper.Subject = "Your request is declined by HR";
                }

                emailVm.LinkUrl = $"{ _configuration["AppUrl"]}declaration/{requestViewModel.RequestNumber}";
                emailVm.HRName  = activeUserName ?? "HR";
                appEmailHelper.MailBodyViewModel = emailVm;
                await appEmailHelper.InitMailMessage();
            }
            catch (Exception e)
            {
                message = e.Message;
            }
            return(message);
        }