Files
abot/mailing/send_tokens.sh
2018-12-02 23:11:32 +02:00

18 lines
429 B
Bash
Executable File

#!/bin/bash
[[ -z "$2" ]] && {
echo "$0 email_list.txt template.txt"
exit
}
set -x
prefix=http://localhost:8041
reply=no.reply@localhost
addresses=$( grep @ "$1" | wc -l )
i=1
../manager token multi_question -n $addresses --prefix $prefix | while read url; do
address=$( grep @ "$1" | sed "${i}q;d" )
cat "$2" | sed "s,{{ url }},$url," | mail -r $reply -s "Invitation to vote" "$address"
sleep 3
i=$(( i + 1 ))
done