zaus / forms-3rdparty-integration

Wordpress Plugin - Forms 3rdparty Integration - a plugin to help integrate 3rdparty services with common WP Forms plugins like Contact Form 7 and Gravity Forms
http://wordpress.org/plugins/forms-3rdparty-integration/
47 stars 14 forks source link

How to Retrieve form `entry_id` from a Gravity Forms Submission for 3rd-Party Integration #129

Open stotes opened 7 months ago

stotes commented 7 months ago

Description: I am working on integrating Gravity Forms submissions with a third-party service using the "Forms: 3rd-Party Integration" WordPress plugin. I need to pass the entry_id of the submitted form along with the form_id to the third-party service. However, I am encountering difficulties in retrieving the entry_id from the form submission.

What I've Tried: I attempted to use GFFormsModel::get_current_lead() to get the entry_id, but it seems that the id is not available in the $lead object returned by this function. Here's the snippet of my current implementation:


function form_add_entry_id_form_id($post, $service, $form, $sid) {
    $lead = GFFormsModel::get_current_lead();
    $post['entry_id'] = null; // Unable to get entry_id here
    $post['form_id'] = $form['id'];

    return $post;
}
add_filter('Forms3rdPartyIntegration_service_filter_post', 'form_add_entry_id_form_id', 10, 4);

Specific Questions:

I would appreciate any guidance or suggestions on how to resolve this issue. Thank you!