I've had Webforms installed and everything is working fine. However, when the user fills out the Webform, the information is mailed to a specific email address. Currently I see the user's filled out form information, username, email, etc.

The problem is, I really need to see their FIRST AND LAST NAME. The token %username just gives me the plain user like Cyberbob13. I want Bob Smith. I can't seem to find the right token, or even find a way to properly designate one, so I can add it to the email settings. Need help.

To clarify, I'm trying to get their First and Last name from their Drupal made account, not anything filled out from the Webform module.

BTW, no anonymous people can use this form. They all have accounts made in Drupal.

Comments

Webform 4.x and Tokens

The new Webform 4.x includes changes to use the D7 tokens which provides more access to additional information such as user fields. See http://drupal.org/node/1609324#tokens

Another option is http://drupal.org/project/webform_tokens

you could try sending the

you could try sending the first and last name as query string (http://whatever.com/webform?first=Bob&last=Smith), then use a webform Get token to fill in the value in the form, ex %get[first] and %get[last]

I'm not sure if I understand

I'm not sure if I understand the bit about the query string. I looked at the webforms token module but didn't seem to help. I feel like there should be some simple token like %firstname %lastname, but am not finding anything like that. I was just wanting to have the system know which user account is filling out the form without requiring a First and Last Name field in the webform (the form is not about the person filling it out).

However, I'm willing to do whatever works. If I need to have the user manually put their name in again for the form, JUST so I can know who submitted it, that would work I guess?

Webform 4.x

I was incorrect about the Webform Tokens module. However, Webform 4.x does provide the feature you want. See http://drupal.org/node/1609324 for more information.

The system knows who's

The system knows who's filling it out based on who's logged in. Where do you need to see the user's first/last name? In the email, on the results, on a report?

What field?

I assume that you have additional fields on top of the username field? If not, there is no support for the request afaik.

If you are just using standard text fields, "[current-user:field-first-name]" or "[current-user:field_first_name]" will be available as of 7.x-4.x. The first token comes from Entity Tokens that pollutes your token registry with a million token options (this module is not recommended unless you really really need it). But just in case you are using the name field module, you can use these tokens in 4.x too. "[current-user:name-field-name:component-given]".

Token coverage is mixed, I am just writing a feature request to provide token support in the email fields (the from, to, and subject fields).

If node tokens are not supported, but submission components are, a hack I have used is to set the default value of a secure hidden value to equal a node token. This is then exposed to the email components latter.


Alan Davison
Back roads somewhere in South America
nobody click here