Skip to content

Commit

Permalink
Merge pull request #2 from AppsDevTeam/feature-fix-contactlists
Browse files Browse the repository at this point in the history
correct typos and changed structure of contaclists array
  • Loading branch information
thorewi committed Aug 9, 2016
2 parents 2338b36 + a0e0e23 commit d1ea4fc
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/SmartEmailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function contactInsert($email, $contactlists = array(), $properties = arr


public function contactUpdate($email, $contactlists = array(), $properties = array(), $customfields = array()) {
$datails = [];
$details = [];

$details['emailaddress'] = $email;

Expand All @@ -36,7 +36,19 @@ public function contactUpdate($email, $contactlists = array(), $properties = arr
}

$details['customfields'] = $customfields;
$datails['contactliststatuses'] = $contactlists;

$contactlistsData = [];

foreach ($contactlists as $id => $status) {
$data = [];

$data['id'] = $id;
$data['status'] = $status;

$contactlistsData[] = $data;
}

$details['contactliststatuses'] = $contactlistsData;

$data = [
'username' => $this->username,
Expand Down

0 comments on commit d1ea4fc

Please sign in to comment.