Added Email Template, Sending email on failure as well as on success.