Templated emails

Fixes #112. Fixes #104.