I've tried this:

$url = "https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/key:ac_alerts/send";    
$content = json_encode('"To": {"Address": "example@example.com", "SubscriberKey": "example@example.com"}');

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
        array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);

$json_response = curl_exec($curl);

$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if ( $status != 201 ) {
    die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));


$response = json_decode($json_response, true);

And I've tried this:


$wsdl = 'https://webservice.exacttarget.com/etframework.wsdl';

    /* Create the Soap Client */
    $client = new ExactTargetSoapClient($wsdl, array('trace'=>1));

    /* Set username and password
    *  here */
    $client->username = 'Ommitted for privacy!';
    $client->password = 'Ommitted for privacy!';

    $ts = new ExactTarget_TriggeredSend();
    $tsd = new ExactTarget_TriggeredSendDefinition();
    $tsd->CustomerKey = "ac_alerts";

    $sub = new ExactTarget_Subscriber();
    $sub->EmailAddress = "znolette@national.aaa.com";
    $sub->SubscriberKey = "znolette@national.aaa.com";

    $ts->Subscribers = $sub;    $ts->TriggeredSendDefinition = $tsd;

    $object = new SoapVar($ts, SOAP_ENC_OBJECT, 'TriggeredSend', "http://exacttarget.com/wsdl/partnerAPI");

    echo "<br><br>";
    $request = new ExactTarget_CreateRequest();
    $request->Options = NULL;
    $request->Objects = array($object);

    $results = $client->Create($request);


} catch (SoapFault $e) {

Neither seems to do ANYTHING. I have no idea where to go from here. Any ideas? Even on just how to output some error code? I'm running these functions after submitting a form on a WordPress site.

  • A few questions: Is the Triggered Send Definitions started in the SFMC application? If so, do the emails show as completed or error? What's the target list/data extension of the Triggered Send Definition? Are you supplying all of the required attributes for those? Apr 20, 2015 at 17:05
  • @AdamSpriggs It is started and running, but it doesn;t show anything. No errors, queued, or completes. The list is define within the application and is already populated with subscribers. It only requires email, sub id, firstName, lastName. I tried adding the name fields, but it still doesn't do anything. I thought I might add that the ONLY things I have done to set this up were adding the exacttarget_soap_client.php file to my server and then running this code on form submit. I called ET support and they couldn't help, but mentioned defining an end point?
    – Zack
    Apr 20, 2015 at 17:24
  • Are you using the correct WSDL for your account? Apr 20, 2015 at 19:58
  • 1
    What happens if you use something like Postman to trigger the send?
    – Timothy
    Apr 21, 2015 at 12:04

1 Answer 1


So, it turns out there were SO many issues with my code:

  1. Wrong directory was referenced for require()
  2. Necessary files were not present on server. The only files needed are listed below and can be found here within "PHP/00 Includes".
    1. exacttarget_soap_client.php
    2. soap-wsse.php
    3. xmlseclibs.php
  3. Triggered Send was created in a business line account, but this account was not referenced in the code
  4. Purpose of this project was to trigger a send to an entire list, but Triggered Send only sends to ONE user and gives the option to add that user to a list. A User Initiated Send was created in GUI (in the default/parent account!) instead.

Here's my final code:


$wsdl = 'https://webservice.exacttarget.com/etframework.wsdl';

if($entry['7'] == "4"){ //This is logic to control when I want to initiate the send
        /* Create the Soap Client */
        $client = new ExactTargetSoapClient($wsdl, array('trace'=>1));

        /* Set username and password */
        $client->username = 'ET MC USERNAME';
        $client->password = 'ET MC PASSWORD';

        $pr = new ExactTarget_PerformRequestMsg();
        $pr->Action = "start";   
        $pr->Definitions =  array();

        $def = new ExactTarget_EmailSendDefinition();
        $def->CustomerKey = "ac_alerts"; //Already existing User Initated Send defined within the GUI of ET

        $pr->Definitions[] = new SoapVar($def, SOAP_ENC_OBJECT, 'EmailSendDefinition', "http://exacttarget.com/wsdl/partnerAPI");

        $pr->Options = NULL;

        $results = $client->Perform($pr);  

        var_dump($results); //This was not working for me until I enabled PHP DEBUG mode in WordPress

    } catch (SoapFault $e) {
        var_dump($e); //This was not working for me until I enabled PHP DEBUG mode in WordPress

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.