Bug fix: would error if template email sent then a non-template email as latter still has template flag set (from the first call)