4
votes

We use Amazon's SES service, and have set up Topics and Subscriptions under SNS (Simple Notification Service) so that we get notification emails when an email is bounced or successfully delivered. That's all working fine.

We sometimes send emails via SES on behalf of one of our partners, and before we can do that we need to verify their email address. The process is that the system asks SES to send out a verification email to the person saying "Example.com wants to send emails on your behalf, is that ok?", with a link for them to click. If they click it, then that email is marked as Verified within SES, and we can use it as a from address.

What I can't work out is how to automate the process of knowing whether they've clicked the link yet. I can log in to the AWS dashboard, and go and look at the list of verified email addresses, but i'd like to make it an automated process.

What would be ideal is if it worked the same way as bounces & deliveries: that i set up a "Verification" topic, and subscribe to it so we get an email like we do with bounces and deliveries. Then, the scheduled job that deals with incoming email notifications can say "Aha, this is a verification email for [email protected]: I'll mark their account as 'ses-verified'".

Does anyone know if it's possible to set this up? All the docs on the SES site just talk about bounces, deliveries and complaints.

thanks, Max

1

1 Answers

2
votes

You can use the GetIdentityVerification api call in the SES part of the awssdk:

https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityVerificationAttributes.html

You could do this in a serverless way by having a lambda function do the check, and expose the lambda as an API endpoint to your application (among other ways).

Alternatively you could just try to send a single test email to a test/internal email address and check if it gives you an error - if its not verified, it will return an error immediately when you try to do the send.

EDIT: If you want to use the CLI instead:

aws ses get-identity-verification-attributes --identities "[email protected]"