I think I understand now how it is intended to work but I was very confused at first. I was confused as to when the email template is using data from the webform-mail.tpl.php or when it is using custom data from the database. Originally I couldn't figure out how to get webform to use the webform-mail.tpl.php file after setting a custom template on the node/[nid]/webform/emails/[email-number] page. I found out that the form will be set to "Default template" even if webform is really using a "Custom template" from the database. In order for me to change this I had to click on "Custom template" and then click back on "Default template". At this point the webform-mail.tpl.php will be used again. At least it was for me.

Overall, I felt it was a little unclear as to what webform was actually doing in the webform-mail template override section. Perhaps the text area could be grayed out when the webform-mail.tpl.php file is being used so it is clear that the data in the text area will not be used. Also, I think the option should start on Custom template if it is indeed using a Custom template from the database.

CommentFileSizeAuthor
#2 webform_template_default.patch716 bytesquicksketch

Comments

quicksketch’s picture

Also, I think the option should start on Custom template if it is indeed using a Custom template from the database.

I think this is the "bug" in this report. If you've overridden the template in your theme, then that becomes the "default" template, even though it's been customized by your theme. Certainly not having the correct default value for "Default" or "Custom" template makes this whole situation much more confusing.

Let's start with just fixing the bug, I'll consider disabling the textarea later, through I'm not very much a fan of making users try to figure out how to enable the textarea.

quicksketch’s picture

Version: 6.x-3.3 » 6.x-3.4
Status: Active » Fixed
StatusFileSize
new716 bytes

Committed attached patch.

quicksketch’s picture

Title: webform-mail.tpl.php template override confusion » E-mail template option always set to "Default" even when a custom template is configured

Clarifying title.

daveparrish’s picture

Yep, that fixes my issue. Thanks quicksketch!

Status: Fixed » Closed (fixed)

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

Michsk’s picture

Fixes it for me also. But it doesnt seem committed tough set to closed/fixed.

I'm still having problems with theming the email but thats another issue.This one is fixed but not committed.

smilterman’s picture

Issue tags: +default, +webform, +custom, +e-mail

Hey everyone,

I'm stuck (again) with another problem in drupal.
My problem with customising e-mails in webform is the following.
My e-mail template is always stuck on custom, so it takes the input from the box below. when I change it to default, it demands if I want to revert any changes etc. but when I save the e-mail settings and go back in, it is still stuck on custom. I think this is why I can't seem to use the webform-mail.tpl.php page.

Any thoughts or ideas?

Thnx in advance.

combert’s picture

I had the same thing happen to me. Turns out you have to disable ckeditor (just click the "Switch to plain text editor" link under the textarea), and then set the dropdown to default. A popup will ask you to confirm this (if not, set it to custom and then default). It should then repopulate the textarea with the default text, but it will use your template.

smilterman’s picture

Issue tags: -default, -webform, -template, -custom, -e-mail

That did the trick, thanks heeps.

I thought it might have someting to do with ckeditor but didn't fiddle around enough apparently :)

Thnx again.

brankoc’s picture

@Combert, I have also encountered this problem, and have reported it separately: http://drupal.org/node/1087926 .

bibek_principal’s picture

Issue summary: View changes

I am using drupal 7.63 and facing the same issue