Created
March 3, 2024 19:35
-
-
Save PhilETaylor/ca72b2be1efadb83018061db2271be84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# composer require aws/aws-sdk-php | |
use Aws\SesV2\SesV2Client; | |
require 'vendor/autoload.php'; | |
define('AWS_ACCESS_KEY_ID', ''); | |
define('AWS_SECRET_ACCESS_KEY', ''); | |
$client = new SesV2Client([ | |
'version' => 'latest', | |
'region' => 'eu-west-2', | |
'credentials' => [ | |
'key' => AWS_ACCESS_KEY_ID, | |
'secret' => AWS_SECRET_ACCESS_KEY, | |
], | |
]); | |
$list = $client->listSuppressedDestinations()->get('SuppressedDestinationSummaries'); | |
echo sprintf('There are %s emails to remove'.PHP_EOL, \count($list)); | |
foreach ($list as $emailListed) { | |
echo 'Deleting Email: '.$emailListed['EmailAddress'].PHP_EOL; | |
$res = $client->deleteSuppressedDestination([ | |
'EmailAddress' => $emailListed['EmailAddress'], | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment