yalcin
1
I have a WP user called “office”.
I’d like to be able to use this user’s email address in a form’s “send to custom email address”.
I.e. I want my form to send to this user, without hardcoding an email address into the field.
Is this possible?
I’m looking at the “User meta - add key after :” option, but not getting too far.
yalcin
2
I’ve written a custom function and am able to return the address as such:
function get_user_email_from_id($user_id)
{
$user_data = get_userdata($user_id);
$user_email = $user_data->user_email;
return "$user_email";
}
and
{echo:get_user_email_from_id(2)}
However I can’t paste this into the "send to custom email address”, as this is not treated as typical dynamic data.