Currently, there are 4 tools use ETS to load templates. They are reset-pass, site-management, profile2 and polls.
But, only polls and profile2 use the function processEmailTemplates defined in ETS.
After a detailed investigation, polls and profile2 define single template per file, while site-management and reset-pass define multiple templates per file. And the function processEmailTemplates cannot handle multiple templates in one file.
This patch give the function ability to handle multiple files in one file. It will first try to guess it's a multiple-template file, and then try the single one.
1. To multiple-template, the root element is <emailTemplates> and for each template, <emailTemplate> is used. To single-template, the root element is <emailTemplate>
2. To multiple-template, <key> can be defined under <emailTemplates> and if another <key> is defined in <emailTemplate> the template-specified key will override the root one.
3. A new model EmailTemplates is added to handle the multiple-template file.
4. If 'owner' is not defined in template, 'admin' is used by default.
5. Some modification made in EmailTemplate model to handle both cases.
I'll add the code to make reset-pas and site-management to use ETS method in some other tickets.