• Resolved blancolandau

    (@blancolandau)


    Hi,

    I am using:
    [hidden post_url default:get]

    in a form and use: [_post_url] in the email message.

    I do receive the email with the URL, but Zapier received the value empty.

    Advise please.
    Jaime

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hi!

    As CF7 says:

    Unlike other mail-tags, special mail-tags are independent from form fields or the submitter’s input.

    So using [_post_url] in the message body or mail fields are OK, but our plugin uses the form fields as “template” to get data.

    Besides that, [hidden post_url default:get] will work only if you pass a “post_url” value into URL’s params ($_GET variable). Check docs to more details.

    To add data without mail tags, you can create a filter to add data like this:
    https://www.ads-software.com/support/topic/special-hidden-fileds-to-zapier/

    In your case, you should add this code:

    add_filter( 'ctz_get_data_from_contact_form', 'jaime_add_data_to_zapier', 10, 2 );
    
    function jaime_add_data_to_zapier( $data, $contact_form ) {
        $submission = WPCF7_Submission::get_instance();
    
        if ( empty( $submission ) ) return $data;
    
        $post_id = (int) $submission->get_meta( 'container_post_id' );
    
        if ( empty( $post_id ) ) return $data;
    
        $post = get_post( $post_id );
    
        $post_url = ( ! empty( $post->ID ) ) ? get_permalink( $post->ID ) : '';
        $data['post_url'] = $post_url;
    
        return $data;
    }

    Thanks for using our plugin.

    Plugin Author Mário Valney

    (@mariovalney)

    Hi!

    Your post gave the idea to add support to Special Mail Tags. So the new version 1.3.0 now support it.

    To send it to Zapier you should add the tag to the new option field as shown in the Screenshot 1.

    For your case, just add a [_post_url].

    Thanks for using our plugin again and a review would be appreciated.

    • This reply was modified 5 years, 11 months ago by Mário Valney.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pass hidden values to Zapier’ is closed to new replies.