diff --git a/mailer.http.class.php b/mailer.http.class.php index d7698656..47542970 100644 --- a/mailer.http.class.php +++ b/mailer.http.class.php @@ -37,8 +37,6 @@ function sparkpostSend() $this->edebug(sprintf('Making HTTP POST request to %s', $this->endpoint)); $result = $http->request($this->endpoint, $data); $this->edebug('Response received'); - $this->edebug('Response headers: ' . print_r($result['headers'], true)); - $this->edebug('Response body: ' . print_r($result['body'], true)); return $this->handle_response($result); @@ -148,6 +146,9 @@ protected function handle_response($response) $this->edebug($response->get_error_messages()); return false; } + + $this->edebug('Response headers: ' . print_r($result['headers'], true)); + $this->edebug('Response body: ' . print_r($result['body'], true)); $body = json_decode($response['body']); if (property_exists($body, 'errors')) {