refactored the e-mail sending code slightly
fixed a bug if the connection to sendgrid was down - exponential backoffs are good, however you actually have to wait the amount of time before continuing...