How to hide empty fields and customize the email template?