Improvements to email template selection.