How to get custom mail tags and pass values to the sheet ?

How to get custom mail tags and pass values to the sheet ?

Article sections

    To get Custom Mail Tags to the Google Sheet Connector Settings Tab of Contact Form :

    1. Cf7 already provides a filter hook wpcf7_special_mail_tags Where you can return a values of custom tag that you have created.

    Example : 

    add_filter(‘wpcf7_special_mail_tags’, function( $output,  $name,  $html ) {
    if ( ‘_custom_tag’ == $name ) {
    return “Custom Tag Value”;
    }
    return $output;
    },  10, 3 );

    Where _custom_tag is the custom tag name.

    2. To get the Custom Mail tags list to the Google Sheet Pro Settings Tab. Use Google Sheet Connector hook gscf7_special_mail_tags.

    add_filter( “gscf7_special_mail_tags”, “add_custom_mail_tag”, 10, 2 );

    function add_custom_mail_tag( $custom_mail_tags, $form_id ) {
    $custom_mail_tags[] = ‘_custom_tag’;
    return $custom_mail_tags;
    }

    Where _custom_tag is same tag you have used in above cf7 hook.

    in Getting Started