diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b67c7..ba391dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/KlaviyoV3Sdk/KlaviyoV3Api.php b/KlaviyoV3Sdk/KlaviyoV3Api.php index 4df97e8..21c1f7a 100644 --- a/KlaviyoV3Sdk/KlaviyoV3Api.php +++ b/KlaviyoV3Sdk/KlaviyoV3Api.php @@ -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;