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));
?>
My output for $result is like this:
object(Guzzle\Service\Resource\Model) {
[protected] structure => null
[protected] data => array()
}
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
I believe you need to use verifyEmailIdentity
not verifyEmailAddress
:
$result = $sesClient->verifyEmailIdentity(array('EmailAddress'=> $email));
As stated in the AWS documentation:
The VerifyEmailAddress action is deprecated as of the May 15, 2012 release of Domain Verification. The VerifyEmailIdentity action is now preferred.
• Further Reading
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
Maybe you can try:
$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"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With