Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As I said in title, htmlmail.tpl.php is ineffective on "Welcome (awaiting approval)" mail in profile settings.
Maybe a bug?
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedPlease provide a step-by-step way to replicate the problem, starting with a clean install of Drupal 7.
Comment #2
epiphanydigital CreditAttribution: epiphanydigital commentedSame issue. The template is applied when using this module's admin page to send a test email, but it is not used for any of the user account emails and defaults to regular mimemail.
Step 1. Install Drupal
Step 2. Install MailSystem
Step 3. Install MimeMail
Step 4. Install HtmlMail
Step 5. Create a .tpl file based on the one provided with HtmlMail
Step 6. Create a text format for HtmlMail.
Step 7. Send a test email from the HtmlMail admin page and check to make sure it works. So far so good.
Step 8. Set HtmlMail as system wide default for the MailSystem module.
Step 9. Go through the reset password or create new account processes or any other Drupal core account prompt that issues an email.
Step 10. Check your email to see that the htmlmail.tpl.php file has not been applied.
Comment #3
authintmedia CreditAttribution: authintmedia commentedI'm facing the same problem, when I send the test email it works perfectly, giving me the desired template and look, however, no matter what I do, it does not add template to user module generated mail.
Comment #4
vegantriathleteHave you copied htmlmail.tpl.php into your theme?
What have you name your custom tpl? Have you named it something like htmlmail--user_register.tpl.php?
Have you cleared cache?
Comment #5
Bestpoint CreditAttribution: Bestpoint commentedI have the same problemen. I used the template htmlmail.tpl.php but that won't work. I cleared the cache more than once
Comment #6
bitcookie CreditAttribution: bitcookie commentedI solved this by deleting all the template files in the htmlmail module folder.
I think since the htmlmail module has a htmlmail--user--password_reset.tpl.php and htmlmail--user.tpl.php, it uses them instead of your template declared htmlmail.tpl.php.
If you don't want to hack the module, you'd have to explicitly re-declare those template files in your theme, so adding htmlmail--user--password_reset.tpl.php and htmlmail--user.tpl.php in your theme folder. That's really lame and messy if you want just one template for all your emails though.
Comment #7
jackdaniel9 CreditAttribution: jackdaniel9 commentedUp What is the solution ?
Comment #8
jackdaniel9 CreditAttribution: jackdaniel9 commentedComment #9
jackdaniel9 CreditAttribution: jackdaniel9 commentedIn template.tpl.php
function YOURTHEME_preprocess_htmlmail(&$variables) {
template_preprocess_htmlmail($variables);
$variables['body'] = check_markup($variables['body'], 'full_html');
}
Comment #10
jackdaniel9 CreditAttribution: jackdaniel9 commentedComment #11
golubovicm CreditAttribution: golubovicm commentedbitcookie's solution works! Thanks a lot, it's live savior.
Comment #12
salvisComment #13
salvis