renaming to clarify variable meaning
add message to email function and template
added alerting for failed jobs