Procedure with Update and email

This procedure I wrote for a certain update statement that runs and
then to send a mail from the database.  It used to run as a shell
script via cron, but changed it to run so it is always in the DB when
we refresh to test etc
SQL to show what events are set in the database