I try to set an Email Send Definition with a Data Extension which is filterd by a Data Filter (exclusionlist). Sending without the Data Filter is no problem but after applying the Data Filter it returns an error "The send definition has the following 1 error(s): The list with ID = 7 was not found for send definition list array element 1."
The Data Filter is created within ExactTarget and set to the Data Extension. The External Key is correct but the list can't be found.
Am I using the Data Filter in a correct way?
Here is a piece of code
$emailSendDef = new ExactTarget_EmailSendDefinition();
$emailSendDef->CustomerKey = $customer_key;
$emailSendDef->Name = $customer_key;
//Setup the Send Classification
$sendClass = new ExactTarget_SendClassification();
$sendClass->CustomerKey = $sendClass_key;
$emailSendDef->SendClassification = $sendClass;
// Setting Up the Source List
$emailSendDef->SendDefinitionList = array();
$listid = "XXXXXXXXXX-XXX-XXXXX-XXXX-XXXXXXXXXXX";
$list = new ExactTarget_DataExtension();
$list->ObjectID = $listid;
$sendDefList = new ExactTarget_SendDefinitionList();
$sendDefList->DataSourceTypeID = "CustomObject";
$sendDefList->SendDefinitionListType = "SourceList";
$sendDefList->CustomObject = $list;
$sendDefList->CustomerKey = $listid;
$emailSendDef->SendDefinitionList[] = $sendDefList;
//ExclusionList
$sendDefExclusionList = new ExactTarget_SendDefinitionList();
$listExclude = new ExactTarget_List();
$listExclude->ID = "YYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYYY";
$sendDefExclusionList->List = $listExclude;
$sendDefExclusionList->DataSourceTypeID = "List";
$sendDefExclusionList->SendDefinitionListType = "ExclusionList";
$emailSendDef->SendDefinitionList[] = $sendDefExclusionList;
// Specify the Email To Send
$email = new ExactTarget_Email();
$email->ID = $email_id;
$emailSendDef->Email = $email;
$object = new SoapVar($emailSendDef, SOAP_ENC_OBJECT, 'EmailSendDefinition', "http://exacttarget.com/wsdl/partnerAPI");
$request = new ExactTarget_CreateRequest();
$request->Options = NULL;
$request->Objects = array($object);
$results = $client->Create($request);
//Set AdditionalEmailAttributes
$this->setAdditionalAttributes($client, $email_id);
I also tried to send it only to de Data Filter
$listId = "7E0FF4C3-1106-4716-92FF-21DA2FA47666";
$list = new ExactTarget_FilterDefinition();
$list->ObjectID = $listId;
$sendDefList = new ExactTarget_SendDefinitionList();
$sendDefList->DataSourceTypeID = "CustomObject";
$sendDefList->SendDefinitionListType = "SourceList";
$sendDefList->CustomObject = $list;
$sendDefList->CustomerKey = $listid;
$emailSendDef->SendDefinitionList[] = $sendDefList;
The e-mail is send with success but the filter is not applied. The filter that is configured is:
data extension values match "DO_NOT_MAIL" != today's date minus 1 Days