api_key = $api_key; } public function send($template) { $url = "http://127.0.0.1:9000/api/project/template/send"; // TODO // $url = "http://127.0.0.1:9000/api/project/template/send"; $client = new Client(); try { return $client->request('post', $url, [ 'form_params' => $template, 'headers' => ['Authorization' => 'Bearer ' . $this->api_key] ])->getBody(); } catch(\Exception $e) { throw new BMailException($e->getMessage()); } } }