Refactor email-sending code in user notification, add human readability

This code centralizes the email-generating code in user notifications, and adds human readability.