Updated html email handler