You are here

public function AmazonSesHandler::getSendStatistics in Amazon SES 2.0.x

Get sending statistics.

Return value

array An array of statistics.

Overrides AmazonSesHandlerInterface::getSendStatistics

File

src/AmazonSesHandler.php, line 289

Class

AmazonSesHandler
Amazon SES service.

Namespace

Drupal\amazon_ses

Code

public function getSendStatistics() {
  $statistics = [
    'DeliveryAttempts' => 1100,
    'Bounces' => 0,
    'Complaints' => 0,
    'Rejects' => 0,
  ];
  $results = $this->client
    ->getSendStatistics();
  foreach ($results
    ->toArray() as $key => $value) {
    $statistics[$key] += (int) $value;
  }
  return array_map('number_format', $statistics);
}