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); } }
$records[] = $record_1; $records[] = $record_2; $merge_obj->setRecordDataParam($fieldNames, $records); $merge_result_ids = $instance->execute($merge_obj); /* * merge call end */ /* * trigger event call begin */ $custom_obj = new triggerCustomEvent(); $custom_event = new CustomEvent(); $custom_event->setEventName("DEV_SUPP_TEST"); $custom_obj->setCustomEventParam($custom_event); $identifier = new RecipientIdentifier(); $identifier->setValue(RecipientIdentifier::RECIPIENT_ID); /* * Transient data is optionalData in Responsys Jargon * These name value pairs can be used to display in the * campaign body and/or evaluated by program logic as ETV or "ENTRY TRACKING VARIABLES" * */ $transientData = array('FIRST_NAME' => 'Scooby', 'LAST_NAME' => 'Doo'); $transientData1 = array('FIRST_NAME' => 'Wilma', 'LAST_NAME' => 'SmartyPants'); $transientDataArray[] = $transientData; $transientDataArray[] = $transientData1; /* * Obtain recipient id from merge call result! */ if (is_array($merge_result_ids->recipientResult)) { foreach ($merge_result_ids->recipientResult as $result) {