[英]How to retrieve response from Amazon SES?
我具有驗證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輸出如下:
object(Guzzle\Service\Resource\Model) {
[protected] structure => null
[protected] data => array()
}
實際上,我在指定的電子郵件ID中收到了經過驗證的電子郵件。 我的問題是,如何使用收到的響應檢查功能是否正常工作? 在早期的Amazon Web服務中,他們使用$result->is('Ok')
來驗證結果。 我現在應該使用哪個功能來檢查該功能的成功和失敗結果?
我已經檢查了亞馬遜鏈接 ,但仍然找不到成功響應的功能
我相信您需要使用verifyEmailIdentity
而不是 verifyEmailAddress
:
$result = $sesClient->verifyEmailIdentity(array('EmailAddress'=> $email));
如AWS文檔中所述:
從2012年5月15日版的域驗證開始,VerifyEmailAddress操作已棄用。 現在首選VerifyEmailIdentity操作。
• 進一步閱讀
查看aws-sdk-php的測試發現:
也許您可以嘗試:
$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"))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.