Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is probably a duplicate but I can't find exactly what's happening here.
In the email to be sent to the user I am unable to make submitted values appear in the text. All I want it to say is something like "Dear Dr. Smith".
I have tried this:
Dear %email[name_title] %email[last_name],
and I have tried this:
Dear %value[name_title] %value[last_name],
and the token itself prints. Both fields are selected in the list of included email values. I can't figure out what I'm doing wrong.
Any suggestions? Many thanks. This is on the whole a great module. Just this one little thing . . .
Comments
Comment #1
quicksketchLooks like this would work. Are your fields for "name_title" and "last_name" under a fieldset or just in the root of the form? Are you sure that the "Field key" for each of these fields is correct?
Comment #2
mollyavalon CreditAttribution: mollyavalon commentedOh, now, see, I am a nitwit.
Thank you so much, quicksketch! My fields ARE in a fieldset, and that is explained right on the email page.
I knew it was user error.
Comment #3
quicksketchSweet, great. For other users finding this thread, any fields under a fieldset are referenced by %value[fieldset_name][field_name].
Comment #5
MadMich CreditAttribution: MadMich commentedI have followed your lead here and added %value[fieldset_name][field_name].
When no text is added to the value field i expected it not to display. Instead of which it displays the '[field_name]' line. Is there anyway of stopping this?
Comment #6
avantwaves CreditAttribution: avantwaves commentedSame problem here.
I am using %value[fieldset_key][field_key] for some fields and %email[fieldset_key][field_key] and all I get is the token printed in the email like:
*User Information:*
[your_email_address]
[your_age]
Instead of:
*User Information:*
Email: someone@emailexample.com
Age: 24
Comment #7
quicksketchI'm having trouble understanding what the input, actual result, and expected result are in these reports. Could you clarify what your exact template code is, where the field is located in your form, and what the result is (with the field blank and with the field filled out).
Comment #8
avantwaves CreditAttribution: avantwaves commentedThese are the fields in the form.
User Information <- Fieldset with key user_information
Name <- key user_name
Email <- key user_email
Age <- key user_age
This is the template.
Submitted on: %date
User Information:
%email[user_information][user_name]
%email[user_information][user_email]
%email[user_information][user_age]
The strange thing is that %date is being printed correctly. The output that I am getting is:
Submitted on: Monday, October 24, 2011 - 12:55
User Information:
[user_name]
[user_email]
[user_age]
Comment #9
quicksketchExcellent, thanks that's a very helpful report. So you're getting the last part of the token no matter what, whether the field is filled out or empty, right?
Comment #10
avantwaves CreditAttribution: avantwaves commentedYes, that is correct. I am getting the last part of the token no matter what.
Also if I move the field outside the fieldset and use %email[user_email] the field prints just fine.
Comment #11
avantwaves CreditAttribution: avantwaves commentedWell now this is strange... all of the sudden all is working just fine. :O I don't know why... cause I didn't change anything... Weird
Comment #12
quicksketchLet's track this issue in #1332820: Parts of nested tokens (in fieldsets) printed when left empty. It looks like the same report but got to the point more quickly.
Comment #13
sgwood CreditAttribution: sgwood commentedPlease note that the token system has now changed in D7
i.e.
Token System Replaced with D7-style Tokens
http://drupal.org/node/1609324
So instead of %value[$key]
it should be now
[submission:values:$key:nolabel]
e.g.
[submission:values:first_name:nolabel]
returns:
Sally
or
[submission:values:first_name]
returns:
First Name: Sally
I was attempting to use the %value[$key]
where only %value[$key] was returned
i.e. it was not parsed.
Comment #14
davidhofmann CreditAttribution: davidhofmann commentedQuestion, with the new format, how do you access the values under a field set?
I have a field key, award_recommendation, and a text field under it, persons_name. I'd like to set the webform subject to Award Recommendation: (Persons Name)
For Example:
Award Recommendation: Bob Rider
Comment #15
DanChadwick CreditAttribution: DanChadwick commentedDrupal 7: [submission:values:YOUR_FIELD_SET_FORM_KEY:YOUR_NESTED_FIELD_SET_FORM_KEY:YOUR_TEXt_FIELD_FORM_KEY]
Drupal 6: no clue.
If this isn't in the webform documentation, please add it. Also it's best to open a new issue, rather than post to a 3 year old issue.
Comment #16
dcanetma CreditAttribution: dcanetma commentedThanks @danchadwick
That worked for me on version 7.
Example would be:
[submission:values:datos_de_la_empresa:nombre_de_la_empresa:withlabel]
Where
* datos_de_la_empresa - machine fieldset name
* nombre_de_la_empresa - machine field name
* withlabel - value modifier
The output looks like this:
nombre_de_la_empresa field label: nombre_de_la_empresa field value
Thanks.
D.
Comment #17
Parvateesam CreditAttribution: Parvateesam commentedHi,
I'm also having same issue "Webform token values not appearing in email text" ,I have tried above all things but i'm getting empty submission values.I'm using below default thing only
Submitted on [submission:date:long]
Submitted by user: [submission:user]
Submitted values are:
[submission:values]
The results of this submission may be viewed at:
[submission:url]
below information getting in my mail text
Submitted on
Submitted by anonymous user:
Submitted values are:
The results of this submission may be viewed at:
Please help me.
Thanks,
Comment #18
DanChadwick CreditAttribution: DanChadwick commentedThis is a Drupal 6 issue. Those tokens don't work in Drupal 6. If you aren't using Drupal 6, open a new issue with exactly what your components are (including their field keys) and what tokens you are using.
Comment #19
Parvateesam CreditAttribution: Parvateesam commentedHi
DanChadwick,
Thanks for your response. I'm working drupal 7 environment. below info is default thing but i'm getting empty results
Submitted on [submission:date:long]
Submitted by user: [submission:user]
Submitted values are:
[submission:values]
The results of this submission may be viewed at:
[submission:url]
Below information getting in my mail text
Submitted on
Submitted by anonymous user:
Submitted values are:
The results of this submission may be viewed at:
My components and field keys are :
Legal First Name -> key legal_first_name
Middle Name -> key middle_name
Legal Last Name -> key legal_last_name
Prefix -> key prefix
Preferred Name -> key preferred
Address Line 1 -> key address_line_1
I have follow below format also for getting submission values in my mail text.
[submission:values:legal_first_name:nolabel]
[submission:values:middle_name:nolabel]
[submission:values:legal_last_name:nolabel]
[submission:values:prefix:nolabel]
[submission:values:preferred:nolabel]
[submission:values:address_line_1:nolabel]
Thanks,
Comment #20
DanChadwick CreditAttribution: DanChadwick commentedOpen a new issue.
Comment #21
Parvateesam CreditAttribution: Parvateesam commentedHi,
DanChadwick,
Issue is resolved i have disabled all dependent modules and disabled token module then again re enabled all modules now working fine.
one more doubt how can i align these key fields and labels with good css design ? below are the my key fields ,i need to display this values in my mail text with good view either tables format or div's
[submission:values:legal_first_name:withlabel]
[submission:values:middle_name:withlabel]
[submission:values:legal_last_name:withlabel]
Please suggest me.
Thanks,
Parvateesam.