Fix #1317 Enhance email template
Merge pull request #550 from nlegoff/template_mail

[3.8] Fix #1317 Enhance email template
Cleanup temporary files