Skip to content

Commit

Permalink
Adds urlencode to email before search request (#299)
Browse files Browse the repository at this point in the history
* encodes email before searching

* updates CHANGELOG
  • Loading branch information
cykolln authored May 22, 2024
1 parent eaa7693 commit 587580b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added StoreId and SimpleProductId fields to Added to Cart event.

#### Fixed
- Properly encodes emails before search request to Klaviyo
- Updated KlaviyoV3Api to fix the profile properties sent in events to match the format required the V3 API

### [4.1.3] - 2024-03-29
Expand Down
3 changes: 2 additions & 1 deletion KlaviyoV3Sdk/KlaviyoV3Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ public function getLists()
*/
public function searchProfileByEmail($email)
{
$response_body = $this->requestV3("api/profiles/?filter=equals(email,'$email')", self::HTTP_GET);
$encoded_email = urlencode($email);
$response_body = $this->requestV3("api/profiles/?filter=equals(email,'$encoded_email')", self::HTTP_GET);

if (empty($response_body[self::DATA_KEY_PAYLOAD])) {
return false;
Expand Down

0 comments on commit 587580b

Please sign in to comment.