According to the documentation, we can "Any textfield, select, or hidden form element may be selected as the subject for e-mails." However, no matter what we do, we cannot seem to get the values to appear in the custom subject.
Lower on the screen it mentions using submission tokens, but the only one I can get to work is the [submission:values] token, and then only in the body field. I have never gotten the [submission:values:?] token to work no matter what I used in place of the "?"
We want to be able to have the subject include the custom text and a field's input value for one of the webform's fields.
Are we misunderstanding how this works?
Comment | File | Size | Author |
---|---|---|---|
webform submission values.png | 19.36 KB | drewpy42 | |
webform email.png | 27.04 KB | drewpy42 |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedThe documentation you reference is probably referring to the "FROM" address for the e-mail, not the subject. It should be updated.
Any component that has a token may be used in the subject or body of the e-mail. For example, if you have a fieldset with a field key of 'address' and within that a textfield with field key of 'last_name', the token for that would be
[submission:values:address:last_name]
.If this isn't working, then perhaps something else is not configured correctly in your installation. Carefully check the spelling of your token, including the field key (which is defined in the component itself). Are other non-webform tokens working properly (such as the current user's name)?
You can also put these tokens in the confirmation message. You can then test out your tokens there, if needed.
Beyond that, I have no idea what might not be working. You'd have to hire a developer to debug what's going on. Given the number of webform installations that use token, I don't think anything is broken within webform itself because we don't have a crush of bug reports.
Good luck and post back with what you eventually figure out.
Comment #2
drewpy42 CreditAttribution: drewpy42 commentedI've used [submission:values:patron_name] (patron_name is the field that I want to put into the subject line with some other text) in the subject and the body and got only blanks on the email subject. If I select the field from the list, then I get the value but my users are wanting to have the subject read "Tech Squad Help Request for " and then the patron's name that was typed into the Patron Name box.
The only time I've gotten anything from the Token part is when I use only [submission:values], [submission:user], and [submission:date:long]. I was wondering if it was something on our end. I'm not sure what could be interfering, but it is possible. We have the following modules installed that interface directly with webform content:
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedI'd try disabling all those modules, except token.
Comment #4
drewpy42 CreditAttribution: drewpy42 commentedThanks! I inherited the website, so I'm not sure which modules are actually in use. Thankfully, I have a development server if things blow up. Appreciate the fast response.
Comment #6
nsshrinivasan CreditAttribution: nsshrinivasan commentedIm facing the same issue while trying to display a hidden field in the confirmation message. In my case the confirmation message displays in a modal form. It looks like the submission tokens are not being interpreted while it is in a modal form screen.
here generated_code is a form_key in my form which is a hidden field. I'm using hook_webform_submission_presave($node, &$submission) hook to generate the value of the hidden field generated_code and want to display it to the user on the confirmation screen.
[submission:values:generated_code]
Comment #7
nsshrinivasan CreditAttribution: nsshrinivasan commentedThe issue was with modal forms code and bolded part code fixes it.
Comment #8
sic CreditAttribution: sic commentedI have the same issue with a simple text field inside a fieldset: [submission:values:fieldsetkeyname:fieldkeyname] is not working. No fancy modules at all :/
Comment #9
flaviovs CreditAttribution: flaviovs commentedConfirmed, [submission:values:fieldsetkeyname:fieldkeyname] alone is not working here (in the email template).
As a workaround, use [submission:values:fieldsetkeyname:fieldkeyname:nolabel].
Comment #10
praveen_91 CreditAttribution: praveen_91 commentedHi, All
i'm using Drupal 7.56 and webform 7.x-4.15.
Use this [data:your_name-value] "your_name" is field_key.
It's work for me
thanks
Comment #11
avinash_thombre CreditAttribution: avinash_thombre as a volunteer and commentedHi Praveen_91,
I'm using the same drupal 7 and webform versions but still the its not working out for me. Use of [data:your_name-value] does not print any values but only blank space. I'm using modal form window for webform submission. Any suggestion how can I proceed?
Comment #12
avinash_thombre CreditAttribution: avinash_thombre as a volunteer and commented[submission:values:FIELDSET_FORM_KEY:FIELD_KEY] is working for me. Don't include any wrapper_key or markup_key and keep it simple(like [submission:values:fieldset_key:field_name]);if present in the nested structure. Or you can try permutation-combination of [submission:values:fieldset_key:markup_key:wrapper_key:field_name:withlabel], it will definitely work.
Best of luck!