I'm trying to setup a email blast using curl in a shell script.
The problem I'm facing is that I have to setup a function just so I can use $f2 but cannot get the function to work in the curl loop.
I tried doing "echo" in the fuction and also removing the $ from emailtext but still nothing.
It justs outputs a blank email.
function emailtext() { "Dear $f2, Testing some Mailgun awesomeness!" }
paste $emaillist $namelist | while IFS="$(printf '\t')" read -r f1 f2
do
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
-F from='Excited User <mailgun@YOUR_DOMAIN_NAME>' \
-F to=$f1 \
-F subject='Hello' \
-F text='$emailtext'
done