I've been searching for a way to choose more than one (two in my case) components values from my webform to set as "E-Mail from name" for a particular webform.
I'm working with separated form-fields for "firstname" and "lastname" for later processing.
So actually I'm only able to select either "firstname" or "lastname" as component in Webform mail settings "E-Mail from name". But I need both. Is there any other option to handle this? I tested to use tokens in the "user defined" field, but this doesn't seems to work. Anybody with an idea?
Comments
Comment #1
asxnot commentedI had the same problem.
I solved it by adding a function theme_mail_headers to my template.php.
In the function I added the following line:
Hope to be helpful.
Comment #2
mlaw commentedI'm facing this issue as well.
what are your calling in the function theme_mail_headers line? Can you post the snippet?
Thanks.
Comment #3
wildebeest commented@asxnot
Could you please explain your solution a little further please?
I'm still searching for a solution..
Thanks in advance!
Comment #4
asxnot commentedI used the theming functions provided by webform module.
Pay attention: In the following, the string {templatename} must be replaced by the name of your template
First of all I added two fields (profile_firstname and profile_lastname) to my webfom.
Then, I added the following lines to the function {templatename}_theme in template.php:
Finally, I added the following function , named {templatename}_webform_mail_headers, to template.php. It overrides the standard theme_webform_mail_headers that is included in the module webform.
In this way, in all the webforms that include the fields profile_firstname and profile_lastname, these fields will be used as the sender of the message.
Comment #5
quicksketchAs a feature, this will be implemented in #300075: Introducing %value (previously %submitted) token to load submitted values.