Hey, please stop Webhook URL validating for Zapier
-
i’m trying to input my Integromat Webhook inside the Zapier integration, but the plugin won’t let me continue.
Integromat’s webhook act the same, so please open the abbility to use it ??
-
it mus start with https://hooks.zapier.com/ but there’s https://hook.integromat.com also
- This reply was modified 4 years, 8 months ago by elbomnetanel.
Hello @elbomnetanel ,
We have integration with Zapier and not with Integromat, so that is why this is not working.
I’ll check with the developers if that would be possible to use both services in just Zapier integration.kind regards,
KasiaActually you don’t have an ‘Integration with Zapier’.
Your integration is really with Webhhoks.Webhooks is a method of sending JSON data to a receiver.
The receiver can be any service which provides Webhooks urls that gathers the data (like Zapier, Integromat and more…).The only thing your developers did here is to restrict the URL input in the ‘integrations’ section of the forms settings – to start with
https://hooks.zapier.com/...
so if any other url we’re being input there – it will cause an error that says something like ‘your url is wrong’.I’ve changed the code in ‘forminator/addons/pro/zapier/forminator-addon-zapier-form-settings.php’
in line 227 i’ve changed the url exception to just
https://
, so i could put any webhook link I want in the settings – and now it works perfect (and it sends data to integromat just as to zapier).I ask you to do it also in the Plug-in’s formal edition – so I won’t lose this modification any update.
- This reply was modified 4 years, 8 months ago by elbomnetanel.
- This reply was modified 4 years, 8 months ago by elbomnetanel.
- This reply was modified 4 years, 8 months ago by elbomnetanel.
- This reply was modified 4 years, 8 months ago by elbomnetanel.
Hello @elbomnetanel ,
Thanks! I’ve passed your suggestion to the Forminator team and they are discussing this.
kind regards,
KasiaHello @elbomnetanel
I hope you are doing well!
We haven’t heard back from you for a while now so we’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.
Kind regards,
NastiaPlus 10 for this! I agree that the validation step restricting to a zapier URL is overly restrictive.
WPMUDEV team, rather than just complaining about the situation, I’m also happy to offer a solution to drop into your next release: If you’re concerned about the general public inputting an invalid Zapier URL, you can add a simple filter to allow us to bypass the zapier prefix test:
$forminator_addon_zapier_do_prefix_test = apply_filters( 'forminator_addon_zapier_do_prefix_test', 'true') === 'true'? true: false; if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 && $forminator_addon_zapier_do_prefix_test) { $current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', Forminator::DOMAIN ), 'webhook_url' ); throw $current_input_exception; }
with the bypass flag set like this:
add_filter('forminator_addon_zapier_do_prefix_test',function($do_prefix_test) {return "false";});
@elbomnetanel Thank you for tracking down the file/line and providing the code change you made! If the above solution never makes it into the codebase, you can submit forms to Integromat (or any other endpoint) by modifying this code to fit your setup:
function sc_sa_forminator_webhook($entry, $form_id, $field_data_array) { if (!$entry->is_spam && 1560 == $form_id) { $post_data = (object)NULL; foreach ($field_data_array as $o) { $the_name = $o['name']; $post_data->$the_name = $o['value']; } // Generated by curl-to-PHP: https://incarnate.github.io/curl-to-php/ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://hook.integromat.com/xxxxxxxxx'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data)); $headers = array(); $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch); } } // fires just before saving the entries after passing all the checkings add_action( 'forminator_custom_form_submit_before_set_fields', 'sc_sa_forminator_webhook', 10 , 3 );
and here’s what shows up in Integromat: https://i.imgur.com/PDdBNP6.png
Hi @lbalzer
Thank you for the feedback and the code.
I’ve pinged the Developers to check the code and suggestion on this ticket.
I’m afraid I don’t see an upcoming update about the Forminator and Zapier integration, but I raised this discussion to the developers again.
Best Regards
Patrick Freitas
- The topic ‘Hey, please stop Webhook URL validating for Zapier’ is closed to new replies.