From 913be64129665703ec08d1c4905d4c2d55b983f9 Mon Sep 17 00:00:00 2001 From: Michael Clark Date: Mon, 19 Jan 2015 09:56:37 -0500 Subject: [PATCH] Added support for Send Object --- ET_Client.php | 6 +++++ objsamples/sample-send.php | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 objsamples/sample-send.php diff --git a/ET_Client.php b/ET_Client.php index 9651dd6..2a2b820 100644 --- a/ET_Client.php +++ b/ET_Client.php @@ -1692,6 +1692,12 @@ function __construct() { } } +class ET_Send extends ET_CUDSupport { + function __construct() { + $this->obj = "Send"; + } +} + function restGet($url) { $ch = curl_init(); diff --git a/objsamples/sample-send.php b/objsamples/sample-send.php new file mode 100644 index 0000000..22af199 --- /dev/null +++ b/objsamples/sample-send.php @@ -0,0 +1,45 @@ +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"; +} + +?> + + +