Example #1
0
        public static NadaMailMessage GetNadaMailMessageBySubjectStartWith(string mailId, string mailSubjectStartsWith)
        {
            NadaMailBox            mailBox = GetNadaMailBox(mailId);
            List <NadaMailMessage> msgs    = mailBox.msgs;

            NadaMailMessage mailMessageTemp =
                msgs.Where(msg => msgs.Any(m => (msg.s.StartsWith(mailSubjectStartsWith)))).FirstOrDefault();

            NadaMailMessage mailMessage = GetNadaMailMessage(mailMessageTemp.uid);

            return(mailMessage);
        }
Example #2
0
        public static NadaMailBox GetNadaMailBox(string mailId)
        {
            var client  = new RestClient("https://getnada.com");
            var request = new RestRequest("/api/v1/inboxes/{mailid}", Method.GET);

            request.AddUrlSegment("mailid", mailId);
            request.RequestFormat = DataFormat.Json;

            IRestResponse response    = client.Execute(request);
            NadaMailBox   nadaMailBox = JsonConvert.DeserializeObject <NadaMailBox>(response.Content);

            return(nadaMailBox);
        }