I need to have a bunch of different webform e-mail templates with different text - how do I create those with code in Drupal 7?
2 Answers
Ok, I got this sorted out, I used hook_form_alter
to get the stuff into the select field, and did an override on the javascript-file from the webform module. I will try to answer it more complety in the next days if I have the time to do so.
-
Any info you can give on this would be great; we're trying to do the exact same thing.– MikeCommented Feb 22, 2017 at 19:11
Webform emails are themeable using .tpl.php
files just as nodes, views etc. There is a THEMING.txt document that ships with Webform that explains exactly how to do what you are after, although the bit you're looking for is near the top:
If you want to edit the e-mail sent by only one particular webform, rename the file "webform-mail-[node id here].tpl.php", replacing [node id here] with the node ID of the webform.
There's also this handbook page on Drupal.org: Customising the emails sent by webform
-
No, that is not my need - I want to have my own e-mail templates - like the default and custom one - not a tpl file, with predefined text.– MiScCommented Aug 14, 2013 at 9:00
-
Ah, so you want to add your own options to that list? E.g. Default, Custom, MiSc 1, MiSc 2?– ChapabuCommented Aug 14, 2013 at 9:04
-