fix email and sms notifications

addresses #273 and #272 and a few other improvements