You are here

private function AmazonSes::getSendQuota in Amazon SES 7.2

Call Query API action GetSendQuota.

This action is throttled at one request per second.

1 call to AmazonSes::getSendQuota()
AmazonSes::performServiceAction in src/AmazonSes.php
Add required parameter & header to the Query according to Query action.

File

src/AmazonSes.php, line 255
Class for interacting with Amazon SES service.

Class

AmazonSes
Modify the drupal mail system to use Amazon SES.

Namespace

Drupal\amazon_ses

Code

private function getSendQuota($action_parameter) {
  $result['error'] = FALSE;
  try {
    $response = $this->sesClient
      ->getSendQuota([]);
    if (!empty($response['Max24HourSend'])) {
      $result['SentLast24Hours'] = check_plain($response['SentLast24Hours']);
      $result['Max24HourSend'] = check_plain($response['Max24HourSend']);
      $result['MaxSendRate'] = check_plain($response['MaxSendRate']);
    }
  } catch (\Aws\Ses\Exception\SesException $e) {
    $result['message'] = $e
      ->getAwsErrorType();
    $result['errorCode'] = $e
      ->getAwsErrorCode();
    $result['error'] = TRUE;
  }
  return $result;
}