You are here

private function AmazonSes::getIdentityVerificationAttributes in Amazon SES 7.2

Call Query API action GetIdentityVerificationAttributes.

This action is throttled at one request per second.

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

File

src/AmazonSes.php, line 147
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 getIdentityVerificationAttributes($action_parameter) {
  $result['error'] = FALSE;
  try {
    $response = $this->sesClient
      ->getIdentityVerificationAttributes([
      'Identities' => $action_parameter['Identities'],
    ]);
    if (!empty($response['VerificationAttributes'])) {
      foreach ($response['VerificationAttributes'] as $key => $value) {
        $result['data'][$key]['VerificationStatus'] = check_plain($value['VerificationStatus']);
        $result['data'][$key]['Identity'] = check_plain($key);

        // Token will be present if Identity id domain.
        if (isset($value['VerificationToken'])) {
          $domain_record_set = "<div class = ''><strong>Name: </strong> _amazonses.{$key} <br/>\n            <strong>Type:</strong> TXT <br/><strong>Value:</strong> {$value['VerificationToken']}";
          $result['data'][$key]['DomainRecordSet'] = $domain_record_set;
        }
      }
    }
  } catch (\Aws\Ses\Exception\SesException $e) {
    $result['message'] = $e
      ->getAwsErrorType();
    $result['errorCode'] = $e
      ->getAwsErrorCode();
    $result['error'] = TRUE;
  }
  return $result;
}