Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void CreateSendDef()
- {
- SoapClient framework2 = new SoapClient();
- framework2.ClientCredentials.UserName.UserName = "XXX";
- framework2.ClientCredentials.UserName.Password = "XXX";
- String requestID;
- String status;
- EmailSendDefinition sd = new EmailSendDefinition();
- sd.CustomerKey = "API Send Definition to DE";
- sd.Name = "API Send Definition to DE";
- SendClassification sc = new SendClassification();
- sc.Name = "Default Commercial";
- sc.CustomerKey = "2239";
- sd.SendClassification = sc;
- SendDefinitionList sdl = new SendDefinitionList();
- sdl.CustomObjectID = "8699590d-8962-de11-8767-001e0bcf2c98"; //This is the ObjectID of the Data Extension, you will need to do a retrieve to find this
- sdl.DataSourceTypeID = DataSourceTypeEnum.CustomObject;
- sdl.DataSourceTypeIDSpecified = true;
- sdl.SendDefinitionListType = SendDefinitionListTypeEnum.SourceList;
- sdl.SendDefinitionListTypeSpecified = true;
- sd.SendDefinitionList = new SendDefinitionList[] { sdl };
- Email em = new Email();
- em.ID = 3096380;
- em.IDSpecified = true;
- sd.Email = em;
- CreateResult[] cresults = framework2.Create(new CreateOptions(), new APIObject[] { sd }, out requestID, out status);
- foreach (CreateResult result in cresults)
- {
- MessageBox.Show(result.StatusMessage);
- }
- MessageBox.Show(requestID + ": " + status);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement