Skip to content

Commit

Permalink
Merge pull request #27 from Jamiewarb/master
Browse files Browse the repository at this point in the history
Added some missing functions related to Contacts and Contact Lists
  • Loading branch information
tim-bezhashvyly authored Nov 18, 2016
2 parents 0ce586f + 675e711 commit 3e36023
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Snowcap/Emarsys/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@ public function updateContact(array $data)
return $this->send(HttpClient::PUT, 'contact', $this->mapFieldsToIds($data));
}

/**
* Deletes a single contact/recipient, identified by an external ID.
*
* @param array $data
* @return Response
*/
public function deleteContact(array $data)
{
return $this->send(HttpClient::POST, 'contact/delete', $data);
}

/**
* Returns the internal ID of a contact specified by its external ID.
*
Expand Down Expand Up @@ -359,6 +370,17 @@ public function createContactList(array $data)
return $this->send(HttpClient::POST, 'contactlist', $data);
}

/**
* Deletes a contact list which can be used as recipient source for the email.
*
* @param string $listId
* @return Response
*/
public function deleteContactList($listId)
{
return $this->send(HttpClient::POST, sprintf('contactlist/%s/deletelist', $listId));
}

/**
* Creates a contact list which can be used as recipient source for the email.
*
Expand All @@ -383,6 +405,18 @@ public function removeContactsFromContactList($listId, array $data)
return $this->send(HttpClient::POST, sprintf('contactlist/%s/delete', $listId), $data);
}

/**
* Get a list of contact IDs that are in a contact list
*
* @param string $listId
* @param array $data
* @return Response
*/
public function getContactsFromContactList($listId, array $data)
{
return $this->send(HttpClient::GET, sprintf('contactlist/%s/contacts', $listId), $data);
}

/**
* Returns a list of emails.
*
Expand Down

0 comments on commit 3e36023

Please sign in to comment.