Drupal 7: Webform-Emails: Send value of a field without its label?

6.7k views Asked by At

I have a Webform on Drupal 7 and I am using it to email the administrator whenever an end user submits an entry on this form.

In the email template, I have defined a custom template and I am sending the data using %email_values token.

However, I also want to send the value of a particular field on this form but not its label.

So I tried using %email[key] where key is the key of that field. But this sends the label of the field as well as its value.

How can I avoid sending the label data in the email?

3

There are 3 answers

0
Kedar Joshi On

Well, this link solves the problem:

Drupal - Tokens for Webform Component Values

https://drupal.org/node/1010648

I used %values[key] to get submitted values.

0
jcdarocha On

With Webform 3.x, it did not work at all on my website.

BUT, i've updated to webform 4.x, and it now works with the code :

Dear [submission:values:first_name],

It shows:

Dear Jean-Charles,

Thank you to user3641116, it helped!

0
Stew West On

Webform previously used its own custom token system to provide common tokens such as %title, %username, or %value[key]. In Webform 4.x, we use the token system provided by Drupal 7 core, which uses a format such as [node:title], [current-user:name], or [submission:values:key].

For all values: [submission:values]

D6 >> D7

%email[$key] [submission:values:$key]

%value[$key] [submission:values:$key:nolabel]

Example: [submission:values:your_details:first_name:nolabel]

See this for more examples: https://drupal.org/node/1609324