Hello,

I was wondering if it is possible to prepopulate the email field with the user's account email. I do not see token replacements for this field.
Then user can decide to keep this email or change when creating the node.

Thanks

Comments

YK85’s picture

I am still not able to get this to work. Can anyone help me out?

I would like to prepopulate with the user's account email address but allow user to change it.

Thanks!

Bilmar’s picture

adding the below code into the Default Value PHP code section should do it:

global $user;
return array(
  0 => array('email' =>$user->mail)
);
YK85’s picture

Status: Active » Fixed

it works great - thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

francescosciamanna’s picture

Issue summary: View changes

For whom may have not enough PHP experience, using Token Field Module can give you the same result without any line of code.