If you need to override the email address to send notifications to the current logged in user, you may do so using the af/form/email/recipient filter.
add_filter( 'af/form/email/recipient', function ( $recipient, $email, $form, $fields ) { // Make sure we are handling the right form. If not, return the set value. if ( $form['key'] !== 'YOUR_FORM_KEY_HERE' ) { return $recipient; } // Get the current user. If found, return email. if ( $user = wp_get_current_user() ) { return $user->user_email; } return $recipient; }, 10, 4 );
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article