sagemath/sagenb — pull request #120 by rmartinjak (2012-12-04 11:31:48+00:00)
Title: Send e-mail notifications to configured address(es)

Let's be honest, how often do you log in to check a running notebook's output for errors?

With the code attached,
* the admin(s) can configure a list of notification recipients in "Settings -> Notebook Settings"
* uncaught exceptions automatically produce a notification and present the user a "500: Internal server error" page
* sending a notification e-mail to the admin(s) can be done with e.g.

```python
from sagenb.notebook.notification import logger
logger.error("something went wrong!")
```
or simply by throwing an exception (that is not caught).

Note: I had to remove the forking-related code in `sagenb.notebook.sage_email` in order to get this to work. This shouldn't be a problem since twisted sends e-mails asynchronously.