You are here

private function AmazonSesClass::getIdentityVerificationAttributes in Amazon SES 7

Call Query API action GetIdentityVerificationAttributes.

This action is throttled at one request per second.

1 call to AmazonSesClass::getIdentityVerificationAttributes()
AmazonSesClass::performServiceAction in includes/classes/amazonses.class.php
Add required parameter & header to the Query according to Query action.

File

includes/classes/amazonses.class.php, line 143
Class for interacting with Amazon SES service.

Class

AmazonSesClass
Modify the drupal mail system to use Amazon SES.

Code

private function getIdentityVerificationAttributes($action_parameter) {
  $response_xml = $this->sesClient
    ->get_identity_verification_attributes($action_parameter['Identities']);

  // Parse the xml response.
  $response = $response_xml->body
    ->to_stdClass();
  if ($response_xml->status == '200') {
    $result['status'] = AMAZON_SES_REQUEST_SUCCESS;
    $entries = $response->GetIdentityVerificationAttributesResult->VerificationAttributes->entry;
    $i = 0;
    if (!is_array($entries)) {
      $entries = array(
        $entries,
      );
    }
    foreach ($entries as $entry) {
      $result['token']['row' . $i]['key'] = check_plain($entry->key);
      $value = $entry->value;
      if (isset($value->VerificationStatus)) {
        $result['token']['row' . $i]['VerificationStatus'] = check_plain($value->VerificationStatus);
      }

      // The verification token for a domain identity. Null for email
      // address identities.
      if (isset($value->VerificationToken)) {
        $domain = $result['token']['row' . $i]['key'];
        $domain_record_set = "<div class = ''><strong>Name: </strong> _amazonses.{$domain} <br/>\n          <strong>Type:</strong> TXT <br/>\n          <strong>Value:</strong> {$value->VerificationToken}";
        $result['token']['row' . $i]['DomainRecordSet'] = filter_xss_admin($domain_record_set);
      }
      $i++;
    }
  }
  else {
    $result['status'] = AMAZON_SES_REQUEST_FALIURE;
  }
  return $result;
}