I am getting this bug with Token version 6.x-1.16 and Content Profile 6.x-1.0. I have some extra user data stored as a content type called "uProfile". I want to send an e-mail every time a user registers. The e-mail sending, and other tokens like [mail] work fine, but the tokens associated with the extra user content does not.

I am using Content Profile Tokens to access these tokens:

[content-profile-uprofile-name]
[content-profile-uprofile-org]
[content-profile-uprofile-phone]
[content-profile-uprofile-referral]

These tokens produce only empty data, making a blank e-mail if I only use the tokens for e-mail content.

The user data is stored fine, as I am able to access them on the user profile page as well as in the database.

Comments

stongo’s picture

In the "Send an HTML mail to an arbitrary mail address" settings, Use the php raw value in check_plain() and see if it works. The trigger you're using builds the email before cck fields are processed, so only raw values are available.

For example to print "field_name":

<?php print check_plain($node->field_name[0]['value']); ?>
stongo’s picture

Status: Active » Needs review
LrsK’s picture

Thank you for the reply. So I need to use PHP code as the entry format? I do not get any token content in the e-mail with the PHP code either. Under "PHP Evaluation" it says that I have access to the following variables:

$account - registered user
$user - acting user

How would I access the tokens that I have created using the PHP method?

mukesh.agarwal17’s picture

you can write a small piece of code in your custom module to be able to use profile first name, last name, etc..

http://www.innoraft.com/blog/use-profile-fields-tokens-user-emails-drupal -- the sample code snippet over here might help..