Adding logging to email