Exemplo n.º 1
0
        public ActionResult GetAllListSegments(string listId, ListSegmentRequest request = null)
        {
            Task <IEnumerable <ListSegment> > result = null;

            if (listId != null)
            {
                result = mailChimpManager.ListSegments.GetAllAsync(listId);
            }

            return(View(result.Result));
        }
Exemplo n.º 2
0
        public ActionResult GetListSegmentResponse(string listId, ListSegmentRequest request = null)
        {
            Task <ListSegmentResponse> result = null;

            if (listId != null)
            {
                result = mailChimpManager.ListSegments.GetResponseAsync(listId, request);
            }

            return(View(result.Result));
        }
        public async Task <ListSegmentResponse> GetResponseAsync(string listId, ListSegmentRequest request = null)
        {
            using (var client = this.CreateMailClient(string.Format(BaseUrl, listId)))
            {
                var response = await client.GetAsync(request?.ToQueryString()).ConfigureAwait(false);

                await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false);

                var segmentResponse = await response.Content.ReadAsAsync <ListSegmentResponse>().ConfigureAwait(false);

                return(segmentResponse);
            }
        }
        public async Task <IEnumerable <ListSegment> > GetAllAsync(string listId, ListSegmentRequest request = null)
        {
            var response = await this.GetResponseAsync(listId, request);

            return(response.Segments);
        }
Exemplo n.º 5
0
 public async Task <IEnumerable <ListSegment> > GetAllAsync(string listId, ListSegmentRequest request = null)
 {
     return((await GetResponseAsync(listId, request).ConfigureAwait(false))?.Segments);
 }
Exemplo n.º 6
0
        public ActionResult GetAllListSegmentMembers(string listId, string segmentId, ListSegmentRequest request = null)
        {
            Task <IEnumerable <Member> > result = null;

            if (listId != null && segmentId != null)
            {
                result = mailChimpManager.ListSegments.GetAllMembersAsync(listId, segmentId, request);
            }

            return(View(result.Result));
        }