You are here

public function ClientService::getClient in Sparkpost email 8

Same name and namespace in other branches
  1. 8.2 src/ClientService.php \Drupal\sparkpost\ClientService::getClient()

Return value

\SparkPost\SparkPost

Overrides ClientServiceInterface::getClient

2 calls to ClientService::getClient()
ClientService::sendMessage in src/ClientService.php
ClientService::sendRequest in src/ClientService.php

File

src/ClientService.php, line 42

Class

ClientService
Class ClientService.

Namespace

Drupal\sparkpost

Code

public function getClient() {
  $config = $this->configFactory
    ->get('sparkpost.settings');
  $httpClient = new GuzzleAdapter($this->client);
  return new SparkPost($httpClient, [
    'key' => $config
      ->get('api_key'),
  ]);
}