This repository was archived by the owner on Mar 24, 2023. It is now read-only.
This repository was archived by the owner on Mar 24, 2023. It is now read-only.
AddStaticSegmentMembers with more than 20K emails results in timeout #208
Open
Description
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