Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

AddStaticSegmentMembers with more than 20K emails results in timeout #208

Open
danceoften opened this issue Oct 13, 2017 · 1 comment
Open
Labels

Comments

@danceoften
Copy link

danceoften commented Oct 13, 2017

Thanx for this super component, I have a problem when creating CampaignSegmentOptions when adding the segment: how can I increase the timeout?
Could I simply AddStaticSegmentMembers multiple times in chunks to the same segment before creating the CreateCampaign?

Here's my code:

`IEnumerable emails ;
//... code to get 25K emails from DB

CampaignSegmentOptions campaignSegmentOptions = null; // default tutti senza segmento

        if (emails != null && emails.Count > 0)
        {
            campaignSegmentOptions = new CampaignSegmentOptions();
            var seg = manager.AddStaticSegment(list, string.Format("{0}-{1}-{2}-{3}", "static", list, title, DateTime.Now.ToString("s")));
            manager.AddStaticSegmentMembers(list, seg.NewStaticSegmentID, new List<EmailParameter>(emails.Select(e => new EmailParameter
            {
                Email = e
            })));

// ------------EXCEPTION HAPPENS HERE
campaignSegmentOptions.SavedSegmentId = seg.NewStaticSegmentID.ToString();
}

        var camp = manager.CreateCampaign("regular", new CampaignCreateOptions
        {
            FromEmail = mailFrom ?? fromEmail,
            FromName = nameFrom ?? fromName,
            ListId = list,
            Subject = subject,
            Title = title,
            GenerateText = true
        }, new CampaignCreateContent
        {
            HTML = completeHtml
        }, campaignSegmentOptions);

//........................`

thanx for you support

@danesparza
Copy link
Owner

I'm glad you've gotten good use out of this component!

FYI: This project is not longer actively maintained. However, it uses ServiceStack under the covers to make an API call here: https://github.com/danesparza/MailChimp.NET/blob/master/MailChimp/MailChimpManager.cs#L3294 so you may want to investigate how to configure servicestack to have an increased timeout.

Other devs who have used the component may be able to add additional information, so I'll leave this question here for others to answer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants