I want to have Formit auto fill a logged in user’s name and email and include them in the sent email. How do I do that?
What do I add in &emailFrom so that it displays the user email like this: [[!+modx.user.id:userinfo=
Thanks for any help
Maybe I’m not understanding your question correctly, but haven’t you just answered your own question?
Doesn’t this work?
[[!FormIt? &hooks=`email` &emailFrom=`[[!+modx.user.id:userinfo=`email`]]` ... ]]
Well I thought that should work too but the email field doesn’t get sent with the form.
I’m still not sure what exactly you are trying to do, but if you want the user to be able to change username or email-address then maybe you can use something like this:
[[!FormIt? &hooks=`email` &emailFrom=`` ... ]] <form class="form" action="[[~[[*id]]]]" method="post"> <input type="text" name="email" id="email" value="[[!+fi.email:default=`[[!+modx.user.id:userinfo=`email`]]`]]" /> <input type="text" name="username" id="username" value="[[!+fi.username:default=`[[!+modx.user.id:userinfo=`username`]]`]]" /> ... </form>
&emailFrom is left empty, it should take the value from the form field
Thanks for your help and pointing me in the right direction.
I had made a mistake in my chunk!! Not enough sleep