public function testSetCampaignParam()
 {
     $campaign_obj = new InteractObject();
     $campaign_obj->setFolderName("some_folder");
     $campaign_obj->setObjectName("my_campaign_name");
     $this->trigger->setCampaignParam($campaign_obj);
     $this->assertInstanceOf('InteractObject', $this->trigger->params['campaign']);
 }
 public function testSetRecipientData()
 {
     $int_obj = new InteractObject();
     $int_obj->setFolderName("some_folder");
     $int_obj->setObjectName("some_contact_list");
     $identifier = new RecipientIdentifier();
     $identifier->setValue(RecipientIdentifier::EMAIL_ADDRESS);
     $ids = array("*****@*****.**", "*****@*****.**");
     $optionalData = array(array("FIRST_NAME" => "Mason", "ZIP" => "12345"), array("FIRST_NAME" => "Tom", "Zip" => "54321"));
     $this->event->setRecipientDataParam($int_obj, $identifier, $ids, $optionalData);
     $this->assertTrue(is_array($this->event->params['recipientData']));
     foreach ($this->event->params['recipientData'] as $key => $recipientObject) {
         $this->assertInstanceOf('recipient', $recipientObject);
     }
 }
<?php

include '../bootstrap.php';
try {
    $instance = new interact();
    $instance->debug = true;
    $instance->intitializeSoapClient($config_file['location']['wsdl'], $config_file['location']['endpoint']);
    if ($instance->login($config_file['auth_regular']['login'], $config_file['auth_regular']['pass'])) {
        $retrieve_obj = new retrieveListMembers();
        $int_obj = new InteractObject();
        $int_obj->setFolderName("Mason");
        $int_obj->setObjectName("masonList1");
        $retrieve_obj->setFieldListParam(array("RIID_", "EMAIL_ADDRESS_", "FIRST_NAME"));
        $retrieve_obj->setIdsToRetrieve(array("*****@*****.**"));
        $retrieve_obj->setListParam($int_obj);
        $retrieve_obj->setQueryColumn(QueryColumn::EMAIL2);
        $results = $instance->execute($retrieve_obj);
        // do something with results?
        print_r($results);
        $instance->logout();
    } else {
        die("Login failed, no reason to go on...");
    }
} catch (SoapFault $fault) {
    print_r($fault);
} catch (Exception $exception) {
    print_r($exception);
}
<?php

include '../bootstrap.php';
try {
    $folder = "Mason";
    $list = "masonList1";
    $instance = new interact();
    $instance->debug = true;
    $instance->intitializeSoapClient($config_file['location']['wsdl'], $config_file['location']['endpoint']);
    if ($instance->login($config_file['auth_regular']['login'], $config_file['auth_regular']['pass'])) {
        /*
         * merge call begin
         */
        $merge_obj = new mergeListMembersRIID();
        $interact_object = new InteractObject();
        $interact_object->setFolderName($folder);
        $interact_object->setObjectName($list);
        $merge_obj->setListParam($interact_object);
        $status = new DefaultPermissionStatus();
        $status->defaultPermissionStatus = DefaultPermissionStatus::OPT_IN;
        $match1 = new MatchColumn();
        $match1->matchColumn = $match1::EMAIL;
        $match_op = new MatchOperator();
        $match_op->matchOperator = $match_op::_NONE_;
        $reject_channel = new RejectChannel();
        $reject_channel->rejectChannel = $reject_channel::EMAIL;
        $update = new UpdateOnMatch();
        $update->updateOnMatch = $update::REPLACE;
        $rule = new ListMergeRule();
        $rule->setDefaultPermissionStatus($status);
        $rule->setInsertOnNoMatch(true);
<?php

include '../bootstrap.php';
$instance = new interact();
// print out the XML of the requests and responses!
$instance->debug = true;
$instance->intitializeSoapClient($config_file['location']['wsdl'], $config_file['location']['endpoint']);
if ($instance->login($config_file['auth_regular']['login'], $config_file['auth_regular']['pass'])) {
    $table_object = new InteractObject();
    $table_object->setFolderName("Mason");
    $table_object->setObjectName("temp_supp_table");
    $fields = array('EMAIL_ADDRESS', 'AGE', 'CITY', 'DATE_MASON');
    $record_data = array('*****@*****.**', 'somestring', 'SanBruno', '2014-08-25T02:00:00.000-08:00');
    $record = new Record();
    $record->setFieldValues($record_data);
    $merge_table_obj = new mergeTableRecordsWithPK();
    $merge_table_obj->setInsertOnNoMatchParam(true);
    $merge_table_obj->setUpdateOnMatch(UpdateOnMatch::REPLACE);
    $merge_table_obj->setTableParam($table_object);
    $records[] = $record;
    $recordData = new RecordData();
    $recordData->setFieldNames($fields);
    $recordData->setRecords($records);
    $merge_table_obj->setRecordDataParam($recordData);
    print_r($merge_table_obj);
    $response = $instance->execute($merge_table_obj);
    $instance->logout();
}
 $rule->setDefaultPermissionStatus($status);
 $rule->setInsertOnNoMatch(true);
 $match1 = new MatchColumn();
 $match1->matchColumn = $match1::EMAIL;
 $rule->setMatchColumn1($match1);
 $match_op = new MatchOperator();
 $match_op->matchOperator = $match_op::_NONE_;
 $rule->setMatchOperator($match_op);
 $reject_channel = new RejectChannel();
 $reject_channel->rejectChannel = $reject_channel::EMAIL;
 $rule->setRejectChannel($reject_channel);
 $update = new UpdateOnMatch();
 $update->updateOnMatch = $update::REPLACE;
 $rule->setUpdateOnMatch($update);
 $merge_trigger_obj->setMergeRuleParam($rule);
 $interact_object = new InteractObject();
 $interact_object->setFolderName("Mason");
 $interact_object->setObjectName("masonCampaign1");
 $merge_trigger_obj->setCampaignParam($interact_object);
 $fields = array('EMAIL_ADDRESS_', 'CITY_');
 $values[] = array("*****@*****.**", "mike");
 $values[] = array("*****@*****.**", "tony");
 foreach ($values as $array) {
     $record = new Record();
     $record->setFieldValues($array);
     $records[] = $record;
 }
 $transientDataArray[] = array("FIRSTNAME" => "Mason");
 $transientDataArray[] = array("FIRSTNAME" => "Sam");
 for ($tmp = 0; $tmp < count($transientDataArray); $tmp++) {
     $optionalDataArray = null;
<?php

include '../bootstrap.php';
try {
    $instance = new interact();
    $instance->debug = true;
    $instance->intitializeSoapClient($config_file['location']['wsdl'], $config_file['location']['endpoint']);
    if ($instance->login($config_file['auth_regular']['login'], $config_file['auth_regular']['pass'])) {
        $retrieve_obj = new retrieveProfileExtensionRecords();
        $int_obj = new InteractObject();
        $int_obj->setFolderName("Mason");
        $int_obj->setObjectName("masonList1_ext");
        $retrieve_obj->setFieldListParam(array("RIID_", "EXT_DATA_SHORT"));
        $retrieve_obj->setIdsToRetrieve(array("12719903"));
        $retrieve_obj->setListExtensionParam($int_obj);
        $retrieve_obj->setQueryColumn(QueryColumn::RECIPIENT_ID);
        $results = $instance->execute($retrieve_obj);
        // do something with results?
        //print_r( $results );
        $instance->logout();
    } else {
        die("Login failed, no reason to go on...");
    }
} catch (SoapFault $fault) {
    print_r($fault);
} catch (Exception $exception) {
    print_r($exception);
}
<?php

include '../bootstrap.php';
try {
    $instance = new interact();
    $instance->debug = true;
    $instance->intitializeSoapClient($config_file['location']['wsdl'], $config_file['location']['endpoint']);
    if ($instance->login($config_file['auth_regular']['login'], $config_file['auth_regular']['pass'])) {
        $campaign_object = new InteractObject();
        $campaign_object->setFolderName("Mason");
        $campaign_object->setObjectName("masonCampaign_promo");
        $progressChunk = new ProgressChunk();
        $progressChunk->setProgressChunk($progressChunk::CHUNK_10K);
        $preferences = new LaunchPreferences();
        $preferences->setEnabledLimit(false);
        // Enabled limit on recipients
        $preferences->setEnableNthSampling(true);
        $preferences->setEnableProgressAlerts(true);
        $preferences->setProgressChunk($progressChunk);
        $preferences->setProgressEmailAddresses("*****@*****.**");
        //$preferences->setRecipientLimit( 1 ); // Limit to only one recipient, good for testing.
        $preferences->setSamplingNthInterval(1);
        $preferences->setSamplingNthOffset(1);
        $preferences->setSamplingNthSelection(1);
        //$proof_options = new ProofLaunchOptions();
        /*
         * To send a proof instead of real message set proof params ( to entire proof list or specified proof email address ) 
         * or leave empty to send live campaign
         * 
        
        $proof_launch_type = new ProofLaunchType();
 // init some vars - these are pre-existing objects in my test account
 $content_folder_location = '/contentlibrary/1_mason';
 $content_folder_file = 'randomFile_' . rand(1, 100) . '.htm';
 $some_random_html = '<html><header><title>Masons api example</title></header><body><div><h1>Hello World!</h1></div><div>Goodbye cruel world</div></body></html>';
 // sample of create document call
 $create_document_obj = new createDocument();
 $int_obj = new InteractObject();
 $int_obj->setFolderName($content_folder_location);
 $int_obj->setObjectName($content_folder_file);
 $create_document_obj->setDocumentParam($int_obj);
 $create_document_obj->setContentParam($some_random_html);
 $create_document_obj->setEncodingParameter($create_document_obj->char_sets[10]);
 $create_doc_result = $instance->execute($create_document_obj);
 // sample of setDocumentContent
 $set_content_obj = new setDocumentContent();
 $int_obj = new InteractObject();
 $int_obj->setFolderName($content_folder_location);
 $int_obj->setObjectName($content_folder_file);
 $set_content_obj->setDocumentParam($int_obj);
 $set_content_obj->setContentParam($some_random_html);
 $set_document_response = $instance->execute($set_content_obj);
 // sample of getDocumentContent
 $get_content_obj = new getDocumentContent();
 $folder_location = $content_folder_location;
 $object_name = $content_folder_file;
 $get_content_obj->setDocumentParam($int_obj);
 $result = $instance->execute($get_content_obj);
 print_r($result);
 $set_document_images_obj = new setDocumentImages();
 $set_document_images_obj->setDocumentParam($int_obj);
 $image_1_name = "random_pic1.jpg";
 $rule->setDefaultPermissionStatus($status);
 $rule->setInsertOnNoMatch(true);
 $match1 = new MatchColumn();
 $match1->matchColumn = $match1::RECIPIENT_ID;
 $rule->setMatchColumn1($match1);
 $match_op = new MatchOperator();
 $match_op->matchOperator = $match_op::_NONE_;
 $rule->setMatchOperator($match_op);
 $reject_channel = new RejectChannel();
 $reject_channel->rejectChannel = $reject_channel::EMAIL;
 $rule->setRejectChannel($reject_channel);
 $update = new UpdateOnMatch();
 $update->updateOnMatch = $update::REPLACE;
 $rule->setUpdateOnMatch($update);
 $merge_trigger_obj->setMergeRuleParam($rule);
 $interact_object = new InteractObject();
 $interact_object->setFolderName("z_ComprehensiveAccountTesting");
 $interact_object->setObjectName("Transactional1ClickthroughCampaign");
 $merge_trigger_obj->setCampaignParam($interact_object);
 $fields = array('EMAIL_ADDRESS_', 'CITY_', 'RIID_');
 $values[] = array("*****@*****.**", "tony");
 foreach ($values as $array) {
     $record = new Record();
     $record->setFieldValues($array);
     $records[] = $record;
 }
 $transientDataArray[] = array("FIRSTNAME" => "Mason");
 $transientDataArray[] = array("FIRSTNAME" => "Sam");
 for ($tmp = 0; $tmp < count($transientDataArray); $tmp++) {
     $optionalDataArray = null;
     foreach ($transientDataArray[$tmp] as $name => $value) {