Hi, I am trying to use the route notification hook to dynamically send the form to the Current Authors Page. To be clear I do not mean the current Posts Author, but if I were to go to the authors profile page: http://mysite.com/author/dangavin I would see an email form that I can fill out and send to this author.
I have found the hook and have tried multiple variations, but with no luck. any ideas?
I am passing this on the author template already:
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
So I was hoping something like this would work... but no luck
add_filter( 'gform_notification_email_1', 'route_notification' );
function route_notification($email_to) {
global $post;
$email_to = $curauth->user_email;
return $email_to;
}