I have frontend profiles on wordpress where i want to implement a contact form 7 form. So i fetch each email from the user via shortcode. the shortcode returns the email adress from the user and i want to get this value now into the TO field of my contact form.

I tried to register a new form tag

    ///// DEVELOP
add_action( 'wpcf7_init', 'custom_add_form_tag_emaill' );

function custom_add_form_tag_emaill() {
    wpcf7_add_form_tag( 'emaill', 'custom_clock_form_tag_handler' ); // "emaill" is the type of the form-tag

function custom_clock_form_tag_handler( $tag ) {
    $display_name = leweb_user('user_email');
    return $display_name;

This is working fine so far, i can see the email on the frontend form, but when i input [emaill] in the TO field i always get an syntax error... can anyone help me with this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.