Hi,

I'm trying to get profile2 fields to appear in the webform submission email and on the webform results page.

I found this: http://drupal.org/node/1398542 which suggest enabling the entity and entity tokens modules. We have both of these installed already but I cannot figure out what to include in the actual email template to get the value.

e.g. assuming we have a profile2 named 'snowflake' and a field in it called 'field_user_firstname' what would be the correct token to incldue int he email template?

I've been trying things like [profile2:snowflake:field_user_firstname] but I'm not getting anywhere.

It would be good to know the proper way to go about this.

Cheers,

Bill

Comments

leanne9’s picture

I am also having this issue, having Entity API and Entity Tokens doesn't seem to help with anything. Like Bill, I've tried all kinds of formats and not having any luck getting Profile2 values to work with a webform. Anyone out there to help us? :)

Update: I see that using Webform 4.x enables use of these tokens... which are not used in 3.x http://drupal.org/node/1609324#tokens ...I am hesitant to update to another development module but might have to!

amjad1233’s picture

I have used following code for profile fields and it worked ( Just a work around if you would say )

First name :

<?php
 
print $account->profile_main['field_first_name']['und'][0]['value'];
?>

Last name :

<?php
 
print $account->profile_main['field_last_name']['und'][0]['value'];
?>

Phone Number :

<?php
 
print $account->profile_main['field_phone_number']['und'][0]['value'];
?>

Hope this helps

Regards,
Amjad

quicksketch’s picture

Status:Active» Closed (fixed)

Update: I see that using Webform 4.x enables use of these tokens... which are not used in 3.x http://drupal.org/node/1609324#tokens ...I am hesitant to update to another development module but might have to!

Yep, Webform 3.x cannot reference Profile2 tokens. You have to use 4.x to use the official D7 token system.

Closing after lack of activity.