Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Added support for Send Object
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAllenClark committed Jan 19, 2015
1 parent 24efbd0 commit 913be64
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ET_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,12 @@ function __construct() {
}
}

class ET_Send extends ET_CUDSupport {
function __construct() {
$this->obj = "Send";
}
}


function restGet($url) {
$ch = curl_init();
Expand Down
45 changes: 45 additions & 0 deletions objsamples/sample-send.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

require('../ET_Client.php');
try {
$myclient = new ET_Client();

// Modify the date below to reduce the number of results returned from the request
// Setting this too far in the past could result in a very large response size

$retrieveDate = "2015-01-15T13:00:00.000";

// Retrieve Filtered Send with GetMoreResults
print "Retrieve Filtered Send with GetMoreResults \n";
$getSend = new ET_Send();
$getSend->authStub = $myclient;
$getSend->props = array("ID","PartnerKey","CreatedDate","ModifiedDate","Client.ID","Client.PartnerClientKey","Email.ID","Email.PartnerKey","SendDate","FromAddress","FromName","Duplicates","InvalidAddresses","ExistingUndeliverables","ExistingUnsubscribes","HardBounces","SoftBounces","OtherBounces","ForwardedEmails","UniqueClicks","UniqueOpens","NumberSent","NumberDelivered","NumberTargeted","NumberErrored","NumberExcluded","Unsubscribes","MissingAddresses","Subject","PreviewURL","SentDate","EmailName","Status","IsMultipart","SendLimit","SendWindowOpen","SendWindowClose","IsAlwaysOn","Additional","BCCEmail","EmailSendDefinition.ObjectID","EmailSendDefinition.CustomerKey");
$getSend->filter = array('Property' => 'SendDate','SimpleOperator' => 'greaterThan','DateValue' => $retrieveDate);
$getSend->getSinceLastBatch = false;
$getResponse = $getSend->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 "\n---------------\n";

while ($getResponse->moreResults) {
print "Continue Retrieve Send with GetMoreResults \n";
$getResponse = $getSend->GetMoreResults();
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 "\n---------------\n";
}
}
catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}

?>



0 comments on commit 913be64

Please sign in to comment.