// Delete List print "Delete List \n"; $deleteList = new ET_List(); $deleteList->authStub = $myclient; $deleteList->props = array("ID" => $newListID); $deleteResponse = $deleteList->delete(); print_r('Delete Status: ' . ($deleteResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $deleteResponse->code . "\n"; print 'Message: ' . $deleteResponse->message . "\n"; print 'Results Length: ' . count($deleteResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($deleteResponse->results); print "\n---------------\n"; // Retrieve List to confirm deletion print "Retrieve List to confirm deletion \n"; $getList = new ET_List(); $getList->authStub = $myclient; $getList->filter = array('Property' => 'ID', 'SimpleOperator' => 'equals', 'Value' => $newListID); $getList->props = array("ID", "PartnerKey", "CreatedDate", "ModifiedDate", "Client.ID", "Client.PartnerClientKey", "ListName", "Description", "Category", "Type", "CustomerKey", "ListClassification", "AutomatedEmail.ID"); $getResponse = $getList->get(); print_r('Get Status: ' . ($getResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $getResponse->code . "\n"; print 'Message: ' . $getResponse->message . "\n"; print_r('More Results: ' . ($getResponse->moreResults ? 'true' : 'false') . "\n"); print 'Results Length: ' . count($getResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($getResponse->results); print "\n---------------\n"; } } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n";
print "\n---------------\n"; if ($postResponse->status) { $newListID = $postResponse->results[0]->NewID; // Adding Multiple Subscribers To a List in Bulk print "Adding Multiple Subscribers To a List in Bulk \n"; $response = $myclient->AddSubscribersToLists($subs, array($newListID)); print_r('Response Status: ' . ($response->status ? 'true' : 'false') . "\n"); print 'Code: ' . $response->code . "\n"; print 'Message: ' . $response->message . "\n"; print 'Results Length: ' . count($response->results) . "\n"; print "Results: \n"; print_r($response->results); print "\n---------------\n"; // Delete List print "Delete List \n"; $deleteList = new ET_List(); $deleteList->authStub = $myclient; $deleteList->props = array("ID" => $newListID); $deleteResponse = $deleteList->delete(); print_r('Delete Status: ' . ($deleteResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $deleteResponse->code . "\n"; print 'Message: ' . $deleteResponse->message . "\n"; print 'Results Length: ' . count($deleteResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($deleteResponse->results); print "\n---------------\n"; } } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?>
// Render the Message by Message Id print "Render the new Message by Message Id \n"; $renderMG = new ET_Message_Guide(); $renderMG->authStub = $myclient; $renderMG->props = array("id" => $IDofPostMessage); $renderRessult = $renderMG->render(); print_r('Retrieve Status: ' . ($renderRessult->status ? 'true' : 'false') . "\n"); print 'Code: ' . $renderRessult->code . "\n"; print 'Message: ' . $renderRessult->message . "\n"; print 'Results Length: ' . count($renderRessult->results) . "\n"; print 'Results: ' . "\n"; print_r($renderRessult->results); print "\n---------------\n"; // Create List print "Create List \n"; $postContent = new ET_List(); $postContent->authStub = $myclient; $postContent->props = array("ListName" => "Test List for Message Guide Send", "Description" => "This list was created with the PHPSDK", "Type" => "Private"); $postResponse = $postContent->post(); print_r('Post Status: ' . ($postResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $postResponse->code . "\n"; print 'Message: ' . $postResponse->message . "\n"; print 'Results Length: ' . count($postResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($postResponse->results); print "\n---------------\n"; if ($postResponse->status) { $listID = $postResponse->results[0]->NewID; $SubscriberTestEmail = "*****@*****.**"; // Create Subscriber on List print "Upsert Subscriber to List \n";