Send emails in views rather than signals
Add tests for shared functions