如何从Amazon SES检索响应? [英] How to retrieve response from Amazon SES?

查看:161
本文介绍了如何从Amazon SES检索响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有用于验证Amazon ses中电子邮件地址的代码

I have the code to verify email address in Amazon ses

<?php
$sesClient = SesClient::factory(array(
            'key'    => 'secret key',
            'secret' => 'secret',
            'profile' => 'user_name',
            'region'  => 'us-east-1'
        ));
$result = $sesClient->verifyEmailAddress(array('EmailAddress'=> $email));
?>

我的$ result输出如下:

My output for $result is like this:

object(Guzzle\Service\Resource\Model) {
    [protected] structure => null
    [protected] data => array()
}

我实际上在指定的电子邮件ID中收到了经过验证的电子邮件。我的问题是,如何使用收到的响应检查功能是否正常工作?在早期的Amazon Web服务中,他们使用 $ result-> is('Ok')来验证结果。我现在应该使用哪个功能来检查该功能的成功和失败结果?

我已经使用 amazon链接进行了检查仍然找不到成功响应的函数

I actually got verified email in the email id I have specified. My question is, how to check whether the function worked correctly using the response I have received? In earlier Amazon web services, they used $result->is('Ok') to verify the result. what function should I use now to check the result for success and failure of that function?

I've checked with the amazon link and still can't find the function for successful response

推荐答案

看着aws-sdk-php的测试发现了这一点:

Looking at tests of aws-sdk-php found this:

https://github.com/aws/aws-sdk-php/blob/master/tests/Aws/Tests/Ses/Integration/IntegrationTest.php#L86

也许您可以尝试:

$sesClient->verifyEmailAddress(array('EmailAddress'=> $email));
$sesClient->waitUntilIdentityExists(array('Identities' => array($email)));
$result = $sesClient->getIdentityVerificationAttributes(array('Identities' => array($email)));
if ('Success' === $result->getPath("VerificationAttributes/{$email}/VerificationStatus"))

这篇关于如何从Amazon SES检索响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆