Switch formatting into a template.

For now, there's no option to override the template but this will come
in a future version.

This also allows us to easily switch to using an HTML email, and
therefore get some nicer formatting.