I would like to override webform-mail.tpl.php so I can add some custom items such as a logo to every mail being sent out. I followed the instructions in THEMING.txt and copied webform-mail.tpl.php from the module's 'templates' directory to the 'templates' subdirectory in my theme directory.

After reading this issue: http://drupal.org/node/949242 I made sure that the form's email settings were set to default (even changing to custom first, changing back, clicking ok to confirm I want to use the default template) but the custom webform-mail.tpl.php seems to be ignored (I added a string to the custom template to identify which one is being used). I have applied the patch from the issue above but that didn't make a difference either (which I expected but, hey, what doesn't hurt...).

I tried deleting everything from the custom template as well but that didn't make a difference and only resulted in empty emails being sent.

Any ideas what I'm missing here? Thanks!

Comments

RedTop’s picture

Additional info:
I encountered this issue and applied the patch: http://drupal.org/node/948212

I cleared cache after changes to webform-mail.tpl.php

adeb’s picture

Did you manage to fix this RedTop? I'm having the same issue.
Using Webform 6.x-3.4 and Mime Mail 6.x-1.0-alpha6

adeb’s picture

I fixed the problem, but I am not exactly sure which action did it.
This is what I changed:
Manually set the template field in the database to "default" (drupal database->webform_emails)
Removed the Mime Mail module
Added the Content-Type headers using a template override in template.php:

// webform html mail
function phptemplate_webform_mail_headers($node, $submission, $email) {
  $headers = array(
    'Content-Type'  => 'text/html; charset=UTF-8; format=flowed; delsp=yes',
    'X-Mailer'      => 'Drupal Webform (PHP/'. phpversion() .')',
  );

  return $headers;
}
quicksketch’s picture

Status: Active » Fixed

Marking this as fixed, as I can't cause the problem to occur either.

adeb’s picture

In my case this issue was the root cause: http://drupal.org/node/787874
The patch will be rolled out in 3.6

quicksketch, thanks for patching!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

davidhendriks’s picture

Version: 6.x-3.4 » 7.x-3.19
Status: Closed (fixed) » Active

What do I have to do so the webform module will not ignore the webform.mail.tpl.php file in my theme directory?
I tried the patch and the manual database update but the module keeps ignoring my webform.mail.tpl.php file.

quicksketch’s picture

What do I have to do so the webform module will not ignore the webform.mail.tpl.php file in my theme directory?

You need to reset the template so there are no modifications by the end-user. Edit the e-mail configuration, and change the select list above the template to use "Default template". If a custom template is being used, the theme's template is never called.

quicksketch’s picture

Status: Active » Closed (fixed)