changed emailer to include logging