Fixed bug where the connection to the database timed out. Decided to close the connection before sending email, and reopen it after sending email to update the SentAt field of the notification that has been sent.