Add notification support for user who wish to receive on invite action

This actually rewrote the entire email function. We are using Jinja2, but we still need to do sanitiation (we have to and we don't have that at the moment).