I'm trying to write a magic that sends a notification once a notebook has finished executing.
Right now, I have this working for errors (i.e. any cell execution with an exception, an email is sent). I've also accomplished this by adding a send_notification function at the end of the notebook, but it would be nice if I could add the magic at the top of a notebook.