AWS_SES_WP_Mail\WP_CLI_Command::get_sending_domain_dns_records PHP Method

get_sending_domain_dns_records() protected method

protected get_sending_domain_dns_records ( $domain )
    protected function get_sending_domain_dns_records($domain)
    {
        $ses = SES::get_instance()->get_client();
        if (is_wp_error($ses)) {
            WP_CLI::error($ses->get_error_code() . ': ' . $ses->get_error_message());
        }
        try {
            $verify = $ses->verifyDomainIdentity(array('Domain' => $domain));
        } catch (\Exception $e) {
            WP_CLI::error(get_class($e) . ': ' . $e->getMessage());
        }
        $dkim = $ses->verifyDomainDkim(array('Domain' => $domain));
        $dns_records[] = array('Domain' => '_amazonses.' . $domain, 'Type' => 'TXT', 'Value' => $verify['VerificationToken']);
        foreach ($dkim['DkimTokens'] as $token) {
            $dns_records[] = array('Domain' => $token . '._domainkey.' . $domain, 'Type' => 'CNAME', 'Value' => $token . '.dkim.amazonses.com');
        }
        return $dns_records;
    }