Hi everyone !
First of all thanks for the great tool ! We now take it into use, as
the piloting had a really good feedback from users.
As we wanted to have possibility to send news to the users I created
this small bash script, which now I would like to offer you :)
It's light / simple / (may) lame, but working very well (at least for
my purposes).
It's absolutely free, please take it, change it, whatever, but don't
blame me for any problem :)
It's working only with mysql backend and only from localhost now (of
course could work from other host than your review board server, but
then you have to add server address to the mysql command line tool.
You need to have working emailing from the host.

Br,
      Peter.

The script:
#!/bin/bash

#Setup these to meet with your setup
SQL_USR='reviewboard'
DATABASE='reviewboard'

#Gathering email addresses from SQL
qry="SELECT email FROM auth_user"

#Sql password will be asked by the next line (because of -p)
emails=$(echo $qry | mysql -u $SQL_USR -p -B -N $DATABASE)

#Create a temp file for the email message
MSG_FILE=$(mktemp)

#Ask the user to provide a subject for the email
echo "Give a subject for the letter"
read sub

#Add extra before the subject ( you may change or remove this )
sub="[RB-NEWS] $sub"

#opening the editor to edit your message, you should have $EDITOR env.
variable. (no fork !)
$EDITOR $MSG_FILE

#Let's spam!
echo "Sending emails..."
for i in $emails ; do
    cat $MSG_FILE | mail -s "$sub" $i
    if [ $? -eq 0 ] ; then
        echo "[OK] - $i"
    else
        echo "[ !!! FAILED !!! ] - $i"
        #you may add exit here, I like to go along
    fi
    #you may add here some sleep, I don't need it.
done

#get rid of my trash
rm $MSG_FILE
exit 0

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to