2022-11-10 21:08:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-11-14 00:11:42 +00:00
|
|
|
PROFILE=$1 # which AWS profile
|
|
|
|
NUMBER=$2 # how many to send
|
|
|
|
FROM=$3 # who we sending from
|
|
|
|
TO=$4 # who we sending to
|
2022-11-10 21:08:44 +00:00
|
|
|
|
2022-11-14 00:11:42 +00:00
|
|
|
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)
|
2022-11-10 21:08:44 +00:00
|
|
|
do
|
2022-11-14 00:11:42 +00:00
|
|
|
sed -i "s/$x /$i /g" message.json
|
|
|
|
x=$i
|
2022-11-10 21:08:44 +00:00
|
|
|
aws ses --region us-west-2 --profile $PROFILE send-email --from $FROM --destination file://destination.json --message file://message.json
|
|
|
|
done
|
2022-11-14 00:11:42 +00:00
|
|
|
|
|
|
|
sed -i "s/$TO/REPLACE_WITH_SENDER/g" destination.json
|
|
|
|
sed -i "s/$x /1 /g" message.json
|