more work on generating the email