I am looking for a function to fill a user meta data automatically when they register.
In the registration form we ask for user email. Once they validate their registration, we want to get that value and store it in a custom field (already created) named "Form_URL" like this : https://www.ourwebsite.com/USEREMAIL/form/
So we need to concatenate "https://www.ourwebsite.com/" the user email and "/form/" and store it in the custom fied "Form_URL" after the registration.
So we start the following function but we are blocked :
add_action('user_register', 'add_form_link', 10, 1);
function add_form_link($user_id)
{
$emailurl = 'https://www.ourwebsite.com/' . ???? . '/form/';
add_user_meta( $user_id, 'Form_URL', $emailurl , true );
}
PS : Our website is a Wordpress and we use Gravity Forms as the registration Form.