Skip to content

Commit

Permalink
Merge pull request #40 from jasonawant/feature/39-addContactToContact…
Browse files Browse the repository at this point in the history
…List

39: added addContactToContactList method
  • Loading branch information
tholder authored Dec 6, 2016
2 parents 367083f + a4b9e78 commit f12168c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Silverpop/EngagePod.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,27 @@ public function addContact($databaseID, $updateIfFound, $columns, $contactListID
}
}

public function addContactToContactList($contactId, $contactListId, $columns) {
$data["Envelope"] = array(
"Body" => array(
"AddContactToContactList" => array(
"CONTACT_ID" => $contactId,
"CONTACT_LIST_ID" => $contactListId,
),
),
);
foreach ($columns as $name => $value) {
$data["Envelope"]["Body"]["AddContactToContactList"]["COLUMN"][] = array("NAME" => $name, "VALUE" => $value);
}
$response = $this->_request($data);
$result = $response["Envelope"]["Body"]["RESULT"];
if ($this->_isSuccess($result)) {
return true;
} else {
throw new \Exception("AddRecipient Error: ".$this->_getErrorFromResponse($response));
}
}

public function getContact($databaseID, $email = null, $recipientId = null, $encodedRecipientId = null , $returnContactLists = false, $columns = null)
{

Expand Down

0 comments on commit f12168c

Please sign in to comment.