Updated logic to look for email templates in custom folder first, then application folder