Esempio n. 1
0
        public ActionResult BatchMember(string listId, string segmentId, BatchSegmentMembers batchSegmentMembers)
        {
            Task <BatchSegmentMembersResponse> result = null;

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

            return(View(result.Result));
        }
Esempio n. 2
0
        public async Task <BatchSegmentMembersResponse> BatchMemberAsync(string listId, string segmentId, BatchSegmentMembers batchSegmentMembers)
        {
            using (var client = CreateMailClient(string.Format(BaseUrl + "/", listId)))
            {
                var response = await client.PostAsJsonAsync(segmentId, batchSegmentMembers).ConfigureAwait(false);

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

                var memberResponse = await response.Content.ReadAsAsync <BatchSegmentMembersResponse>().ConfigureAwait(false);

                return(memberResponse);
            }
        }