Implement email notification.

The email notification functionality needs to be fully implemented.