private bool AddNotificationMessage(ContractNotificationModel contractModel)
        {
            try
            {
                var     notificationModel            = new GenericNotificationViewModel();
                var     notificationTemplatesDetails = new NotificationTemplatesDetail();
                var     userList        = new List <User>();
                var     receiverInfo    = new User();
                Guid?   receiverGuid    = Guid.Empty;
                decimal thresholdAmount = 0.00M;

                notificationModel.ResourceId              = contractModel.ContractGuid;
                notificationModel.RedirectUrl             = _configuration.GetSection("SiteUrl").Value + ("/contract/Details/" + contractModel.ContractGuid);
                notificationModel.NotificationTemplateKey = contractModel.key;
                notificationModel.CurrentDate             = CurrentDateTimeHelper.GetCurrentDateTime();
                notificationModel.CurrentUserGuid         = UserHelper.CurrentUserGuid(HttpContext);
                notificationModel.SendEmail = true;


                var keyPersonnels = _contractService.GetKeyPersonnelByContractGuid(contractModel.ContractGuid);

                if (keyPersonnels?.Any() == true)
                {
                    receiverGuid = keyPersonnels.FirstOrDefault(x => x.UserRole == ContractUserRole._contractRepresentative)?.UserGuid;
                    if (receiverGuid != Guid.Empty)
                    {
                        thresholdAmount = RevenueRecognitionHelper.GetAmountByContractType(_configuration, contractModel.ContractType);

                        receiverInfo = _userService.GetUserByUserGuid(receiverGuid ?? Guid.Empty);

                        var    resourcevalue = _resourceAttributeValueService.GetResourceAttributeValueByValue(contractModel.ContractType);
                        string contracttype  = string.Empty;
                        if (resourcevalue != null)
                        {
                            contracttype = resourcevalue.Name;
                        }

                        if (receiverInfo != null)
                        {
                            userList.Add(receiverInfo);
                            notificationModel.IndividualRecipients = userList;
                        }

                        var keyList = "<ul>";
                        keyList += "<li>" + receiverInfo.DisplayName + " (" + receiverInfo.JobTitle + ")" + "</li>";
                        StringBuilder additionalUser = new StringBuilder(keyList);

                        notificationTemplatesDetails.ContractNumber   = contractModel.ContractNumber;
                        notificationTemplatesDetails.Title            = contractModel.ContractTitle;
                        notificationTemplatesDetails.ContractType     = contracttype;
                        notificationTemplatesDetails.ContractTitle    = contractModel.ContractTitle;
                        notificationTemplatesDetails.ProjectNumber    = contractModel.ProjectNumber;
                        notificationTemplatesDetails.AdditionalUser   = additionalUser.ToString();
                        notificationTemplatesDetails.ThresholdAmount  = thresholdAmount;
                        notificationTemplatesDetails.Status           = "";
                        notificationModel.NotificationTemplatesDetail = notificationTemplatesDetails;
                        _genericNotificationService.AddNotificationMessage(notificationModel);
                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                var userGuid = UserHelper.CurrentUserGuid(HttpContext);
                EventLogHelper.Error(_eventLogger, new EventLog
                {
                    EventGuid   = Guid.NewGuid(),
                    Action      = "Index",
                    Application = "ESS",
                    EventDate   = DateTime.UtcNow,
                    Message     = ex.Message,
                    Resource    = ResourceType.Contract.ToString(),
                    StackTrace  = ex.StackTrace,
                    UserGuid    = userGuid
                });
                return(false);
            }
        }