Zapier and add_entry() [RESOLVED]

Hi there,
So I’ve hit a small snag with the Zapier Plugin. I am adding four entries through:

GFAPI::add_entry($entry);

That works no problem. Those entries come out like normal. But then I attempt to post those entries to Zapier through:

add_action( 'gform_post_add_entry',  'gaws_send_to_zapier', 10, 2 );
function gaws_send_to_zapier( $entry, $form ) {
    GFCommon::log_debug( 'gform_post_add_entry: entry => ' . print_r( $entry ) );
    if (class_exists('GFZapier')) {
	    GFZapier::send_form_data_to_zapier( $entry, $form );
    }
}

And that ALMOST works. What that keeps doing is it is sending the four entries I am submitting as just the first entry four times.

So does anyone one know why it is doing that and have an inkling to how to fix it?

Thanks!

Can you share all your code, and a link to your log files? Thank you.

To improve performance the Zapier add-on caches the request body and uses it to process all the feeds in the request; it only expects one entry to be processed during a request.

You can use the following filter to prevent it using the cached request body, so it will regenerate it for each entry you pass:

add_filter( 'gform_zapier_use_stored_body', '__return_false' )

2 Likes

LOL I just figured that out and was coming to repost LOL

But thanks!

1 Like