Skip to content

Commit

Permalink
Added custom field param into get contact calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
nachosalvador committed Apr 21, 2020
1 parent 82892d2 commit a472789
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/AcrelianewsContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ public function edit(int $listId, string $email, int $subscribe, int $emailForma
* Gets contact from list by email.
* @see http://manager.acrelianews.com/api/v2/apidoc/#api-Contactos-Get_List_Contacts_Email
*/
public function getByEmail(int $listId, string $email): string
public function getByEmail(int $listId, string $email, bool $customFields = TRUE): string
{
$tokens = [
'id' => $listId,
'email' => $email,
];

return $this->request('GET', '/lists/{id}/contacts/{email}', $tokens);
return $this->request('GET', '/lists/{id}/contacts/{email}', $tokens, ['custom_fields' => $customFields]);
}

/**
* Gets contact from list by ID.
* @see http://manager.acrelianews.com/api/v2/apidoc/#api-Contactos-Get_List_Contacts_Id
*/
public function getById(int $listId, int $contactId): string
public function getById(int $listId, int $contactId, bool $customFields = TRUE): string
{
$tokens = [
'id' => $listId,
'contact_id' => $contactId,
];

return $this->request('GET', '/lists/{id}/contacts/{contact_id}', $tokens);
return $this->request('GET', '/lists/{id}/contacts/{contact_id}', $tokens, ['custom_fields' => $customFields]);
}
}

0 comments on commit a472789

Please sign in to comment.