Manage Sends to Publication Lists using Email Send Definitions

This page contains information about managing subscriptions to and unsubscriptions from publication lists via email send definitions.

Why Manage Sends to Subscribed and Unsubscribed Recipients on Publication Lists 

If you store subscriber information in data extensions, you need to use publication lists in order to facilitate email sends. Using the sample code in this document helps you manage which subscribers do or don’t receive messages. The email send definition uses the publication list to conduct the send, and subscribers can subscribe or unsubscribe from the list via email links or a profile center.

How to Manage Sends to Subscribed and Unsubscribed Recipients on Publication Lists 

Use the sample code below as a model for your own call.

Sample .NET Code 

1public CreateResult[] CreateESD()
2{
3    EmailSendDefinition esd = new EmailSendDefinition();
4    esd.Email = new Email();
5    esd.Email.ID = 12345; //The ID of the email I wish to send
6    esd.Email.IDSpecified = true;
7    esd.CustomerKey = "Example 2"; //Setting the customer/external key of this email send definition
8    esd.Name = "Example 2"; //Setting the name of this email send definition
9    esd.SendClassification = new SendClassification();
10    esd.SendClassification.CustomerKey = "12345"; //This is the customer/external key of my default commercial send classification
11    esd.SendDefinitionList = new SendDefinitionList[1];
12    esd.SendDefinitionList[0] = new SendDefinitionList();
13    esd.SendDefinitionList[0].DataSourceTypeID = DataSourceTypeEnum.CustomObject; //Identifies data extension (CustomObject) as the target
14    esd.SendDefinitionList[0].DataSourceTypeIDSpecified = true;
15    esd.SendDefinitionList[0].CustomObjectID = RetrieveDXNID("12345"); //Pass the customer/external key of the data extension
16    esd.SendDefinitionList[0].List = new List();
17    esd.SendDefinitionList[0].List.ID = 12345; //The ID of the publication list to use with this data extension and email send definition
18    esd.SendDefinitionList[0].List.IDSpecified = true;
19    string status;
20    string requestID;
21    CreateResult[] results = client.Create(new CreateOptions(), new APIObject[] { esd }, out requestID, out status);
22    return results;
23}

See Also