0

https://solspace.com/docs/freeform/extension_hooks/#freeform_module_insert_end

I am using the freeform_module_insert_begin hook which stores the data into the database but with the freeform_module_insert_end hook I am unable to get the data which I posted in the freeform_module_insert_begin hook.

Here is my code:

function email_this($field_input_data, $entry_id, $form_id){
if (ee()->extensions->active_hook('freeform_module_insert_end') === TRUE)
{
    ee()->extensions->universal_call(
    'freeform_module_insert_end',
    $field_input_data,
    $entry_id,
    $form_id,
    $this
    );
} else {
    //else
}
}

1 Answer 1

1

The entire $_POST array should still be available inside that hook (though for security you should access it via ee()->input->post()).

But your code is incorrect (I can see how the docs are confusing there). What you've posted is their demonstration of how the hook appears inside the module - not an example of how to use the hook.

You need to first insert a row into exp_extensions which maps freeform_module_insert_end to your email_this function (see docs). Then just write your function like so:

function email_this($field_input_data, $entry_id, $form_id, $freeform_object)
{
    // Do what you need to do in here
    // ee()->input->post('my_field_name') should be available here as well
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.