implemeting html email based on setting