fix html email body, add logging