if the user is logged in, you can get the user id using the below code:
global $current_user;
get_currentuserinfo();
$user_id = $current_user->user_ID;
Now, when the form is sent, you can save the current time in wp_usermeta table. Use like this:
$current_time = time();
update_usermeta($user_id, 'form_sent_at', $current_time);
Thank you very much for the answer!
But i don’t get it to work. Do you use the FormBuilder plugin?
Where should i put this code? I try to put it in the value field. but it does not seems right to put this there, all i get in the e-mail that is sent to me is the whole code.
Can i put this in the page and then call something in the value field?
thank you!
I just downloaded and checked this plugin. I am not sure, but I think you need to add this code in main formbuilder.php file. The mail function is called on line 1285. You can try in this area.
Cool, i’m gonna check it out!