Posted by adriaanm on May 27, 2011 at 8:56am
4 followers
Jump to:
| Project: | HTML Mail |
| Version: | 7.x-2.x-dev |
| Component: | Documentation |
| Category: | task |
| Priority: | normal |
| Assigned: | pillarsdotnet |
| Status: | needs work |
Issue Summary
I have a global htmlmail.tpl.php template in my e-mail theme which works fine for all my emails (i.e. webform mails). However, this template isn't used for user e-mails (like password recovery), unless i specify a more specific template.
For example: htmlmail--user--password_reset.tpl.php works for password recovery e-mails, but when I remove it, the global htmlmail.tpl.php template isn't used for this e-mail.
Comments
#1
You'll need to remove the extra template from both the htmlmail module directory and your theme directory, if you're using an email theme.
Then you'll need to visit admin/config/development/performance and clear your cache.
If this doesn't work, then let me know, because something is broken and I need to fix it.
#2
I should document this better.
#3
Thanks for your quick response, it works when i remove htmlmail--user--password_reset.tpl.php in the htmlmail directory.
However, isn't it strange that the template for password recovery in the htmlmail directory is used over my custom template in my e-mail theme? This is not the case with htmlmail.tpl.php. Shouldn't the module give precedence to custom template files in the e-mail theme directory?
Removing htmlmail--user--password_reset.tpl.php in the htmlmail directory works, but this file will always be recreated when updating the module.
#4
If you have a file called htmlmail-user--password_reset.tpl.php in your e-mail theme directory, and it isn't getting used for password reset emails, then I want to hear about it.
The order of precedence should be:
$theme_directory/htmlmail--$module--$key.tpl.php$module_directory/htmlmail--$module--$key.tpl.php$theme_directory/htmlmail--$module.tpl.php$module_directory/htmlmail--$module.tpl.php$theme_directory/htmlmail.tpl.php$module_directory/htmlmail.tpl.phpIf that order is not being followed, please tell me and I'll try to fix the problem.
#5
#6
Isn't it a better idea to remove the htmlmail--user--password_reset.tpl.php file from the module entirely? This just serves as an example and places an additional burden on the users of the module.
I suspect the most common use case is to *not* have a customized user password email. To make this use case work as expected there are two options now:
I would not throw away this file, as it is useful as an example. But a better home for it would be inside a documentation page, and not in the module folder.
#7
Or maybe an examples folder.
#8
Isn't it just weird that templates in the module folder get preferred over the template folder? It shouldn't be necessary to change the module folder. Now I need to remove all template files from there to use a htmlmail.tpl.php in my theme folder.
Why not only search the module folder after all tries in the theme folder have failed? That would be a lot more logical and more in line with other systems.
The Module folder shouldn't be edited.