public static PersonSetting GetPerson(SirenOfShameSettings settings, string element)
 {
     var rawName = element;
     var person = settings.FindPersonByRawName(rawName);
     if (person == null)
     {
         _log.Error("Unable to find person from news item: " + rawName);
         return null;
     }
     return person;
 }
        private void SendNewCustomImages(SirenOfShameSettings settings, List<InstanceUserDto> changedUsers)
        {
            var changedPeople = changedUsers
                .Select(changedUser => settings.FindPersonByRawName(changedUser.RawName))
                .Where(person => person != null);

            var changedPeopleWithUnUploadedCustomImages = changedPeople
                .Where(i => !string.IsNullOrEmpty(i.AvatarImageName) && !i.AvatarImageUploaded);

            foreach (var person in changedPeopleWithUnUploadedCustomImages)
            {
                var webClientXml = new WebClientXml();
                AddSosOnlineCredentials(settings, webClientXml);
                webClientXml.Add("AvatarImageName", person.AvatarImageName);
                var avatarImagePath = SirenOfShameSettings.GetAvatarImagePath(person.AvatarImageName);
                var imageAsBytes = File.ReadAllBytes(avatarImagePath);
                var imageAsString = Convert.ToBase64String(imageAsBytes);
                webClientXml.Add("AvatarImage", imageAsString);
                string url = SOS_URL + "/ApiV1/AddImage";
                var person1 = person;
                webClientXml.UploadValuesAndReturnStringAsync(url, s => _log.Debug("Uploaded " + person1.AvatarImageName), ex => _log.Error("Error uploading image for " + person1.AvatarImageName), settings.GetSosOnlineProxy());
                person.AvatarImageUploaded = true;
                settings.Save();
            }
        }