← All changes
|
includes/Core/Integration/ElasticEmail/ElasticEmailHandler.php
+3
-2
2.10.0
→
2.15.3
View file →
| @@ -39,15 +39,16 @@ | ||
| 39 | 39 | |
| 40 | 40 | $apiEndpoint = 'https://api.elasticemail.com/v4/lists'; |
| 41 | 41 | $apiKey = $requestsParams->api_key; |
| 42 | 42 | $header = [ |
| 43 | - 'X-ElasticEmail-ApiKey' => 22423423423423423, | |
| 43 | + 'X-ElasticEmail-ApiKey' => $apiKey, | |
| 44 | 44 | 'Accept' => '*/*', |
| 45 | 45 | ]; |
| 46 | 46 | $apiResponse = HttpHelper::get($apiEndpoint, null, $header); |
| 47 | + | |
| 47 | 48 | if (is_wp_error($apiResponse) || isset($apiResponse->Error)) { |
| 48 | 49 | wp_send_json_error( |
| 49 | - empty($apiResponse->code) ? 'Unknown' : $apiResponse->Error, | |
| 50 | + $apiResponse->Error, | |
| 50 | 51 | 400 |
| 51 | 52 | ); |
| 52 | 53 | } |
| 53 | 54 | wp_send_json_success(true); |