I've been a reader for a while. Usually deal with stuff on my own but today I need a hint.
So I've been tasked to run an email campaign at my new job (100k audience) with minimal budget spent and very short notice (tomorrow). I leaned toward AWS (Amazon Web Services) because Amazon SES (Simple Email Service) is very cheap and you only pay what you use.
tried to use AWS SDK on command line. I made a tiny script to read the adresses file (.txt) line by line and execute a send mail command
#! /bin/bash
file='./test-list.txt'
from='sender@domain.com'
for line in $(<$file)
do
#send mail
aws ses send-templated-email --source=$from --destination=$line --template 'test' --template-data ""
done
Script returned the error message :
Error parsing parameter '--destination': Expected: '=', received: '@' for input:
To:recipient@domain.com
Now I'm not the bash king, but I've tried different parameter formulations and nothing got me rid of the error. each line from the input file is a correct email address, and this looks like a parsing issue, but I don't get it.
any ideas ? It would help a ton :)
You need to use the correct format for destination from https://docs.aws.amazon.com/cli/latest/reference/ses/send-templated-email.html#options
Example using send-email
:
aws ses send-email --from "example.com" --destination "ToAddresses=${line}" --text "hello world!" --subject "test"
Example like the one given:
aws ses send-templated-email --source $from --destination "ToAddresses=${line}" --template "test" --template-data ""