Skip to content

Commit

Permalink
make has more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Apr 22, 2016
1 parent 125e0da commit 500c8b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All Notable changes to `laravel-newsletter` will be documented in this file

#3.0.2 - 2016-04-22
- make has `hasMember` more robust

#3.0.1 - 2016-04-22
- fixed the `hasMember` function

Expand Down
12 changes: 10 additions & 2 deletions src/Newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,17 @@ public function getMember($email, $listName = '')
*/
public function hasMember($email, $listName = '')
{
$this->getMember($email, $listName);
$response = $this->getMember($email, $listName);

if (! isset($response['email_address'])) {
return false;
}

if ($response['email_address'] != $email) {
return false;
}

return $this->lastActionSucceeded();
return true;
}

/**
Expand Down

0 comments on commit 500c8b6

Please sign in to comment.