2

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
  • If you logged into the application, put this DataFilter in a Filter Activity and ran it, do you get the results you'd expect? – Timothy Apr 25 '14 at 14:37
0

Sorry, I can't add a comment atm but in your second example you have DataSourceTypeID specified as "CustomObject" while I believe it should be "FilterDefinition" since you are sending to a filter.

Also, as Timothy suggested - did you try running the filter in UI and then validating the results in target DE?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.