Abstract tooling

This commit is contained in:
idanoo 2022-11-14 13:11:42 +13:00
parent d4fa33b233
commit afe005d785
Signed by: idanoo
GPG Key ID: 387387CDBC02F132
4 changed files with 23 additions and 5 deletions

8
README.md Normal file
View File

@ -0,0 +1,8 @@
# SES-email-blast
Used to send bulk test emails for.. purposes
Usage:
```
$ bash send.sh <AWS Profile> <Num of msgs> <from email> <to email>
```

View File

@ -1,5 +1,5 @@
{ {
"ToAddresses": ["test@test.com"], "ToAddresses": ["REPLACE_WITH_SENDER"],
"CcAddresses": [], "CcAddresses": [],
"BccAddresses": [] "BccAddresses": []
} }

View File

@ -1,6 +1,6 @@
{ {
"Subject": { "Subject": {
"Data": "Test email sent using the AWS CLI", "Data": "1 - Test email sent using the AWS CLI",
"Charset": "UTF-8" "Charset": "UTF-8"
}, },
"Body": { "Body": {

16
send.sh
View File

@ -1,9 +1,19 @@
#!/bin/bash #!/bin/bash
PROFILE=$1 PROFILE=$1 # which AWS profile
FROM=$2 NUMBER=$2 # how many to send
FROM=$3 # who we sending from
TO=$4 # who we sending to
for i in {1..100} x=1
sed -i "s/REPLACE_WITH_SENDER/$TO/g" destination.json
echo "Sending $NUMBER messages to $TO from $FROM"
for i in $(seq 1 $NUMBER)
do do
sed -i "s/$x /$i /g" message.json
x=$i
aws ses --region us-west-2 --profile $PROFILE send-email --from $FROM --destination file://destination.json --message file://message.json aws ses --region us-west-2 --profile $PROFILE send-email --from $FROM --destination file://destination.json --message file://message.json
done done
sed -i "s/$TO/REPLACE_WITH_SENDER/g" destination.json
sed -i "s/$x /1 /g" message.json