argosantifex
Forum Replies Created
-
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskHi Mario,
Thank you so much for all your help, just ran a test and it’s working perfectly!
Adding this code to form an array:
add_filter( 'ctz_get_data_from_contact_form', 'flodesk_ctz_get_data_from_contact_form' ); function flodesk_ctz_get_data_from_contact_form( $data ) { // EDIT YOUR DATA $data['segment_ids'] = array('a1b2c3d4e5f6'); return $data; }
and adding this code that you just provided:
add_filter( 'ctz_hook_url_placeholder', 'flodeskemail_ctz_hook_url_placeholder', 10, 4 ); function flodeskemail_ctz_hook_url_placeholder( $encoded_value, $placeholder, $key, $data ) { if ( $key === 'email' ) { return $data[ $key ]; // Ignoring encoded value } return $encoded_value; }
and then adding
https://api.flodesk.com/v1/subscribers/[email]/segments
Worked perfectly!
Thank you once again for helping me with this I’ve felt like I’ve learnt so much from working on this project with you!
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskHi,
So when I tested using my Microsoft Flow routine, i added the two Webhook requests one after the other so User Create then User Add fo segment and that works.
Is there anyway we can get over the URL encoded option. Support still hasn’t come back to me yet.
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskOkay using webhook.site I’ve managed to figure it out so I can send the Segment ID how I need to and verified it using Postman however the code still doesn’t work with the plugin using the new 3.0 update provided.
When I set my URL to:
https://api.flodesk.com/v1/subscribers/[email]/segments
The user isn’t added to the segement, but if I do
https://api.flodesk.com/v1/subscribers/[email protected]/segments
and fill in my CF7 form, the user is added to the segment. So, the new issue seems to be that its not picking up the variable? I’ve checked my form and my email field is configured as [email].
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskSorry to keep coming back to you Mario but still no success. I’ve created a new snippet and used the following code:
add_filter( 'ctz_get_data_from_contact_form', 'flodesk_ctz_get_data_from_contact_form' ); function flodesk_ctz_get_data_from_contact_form( $data ) { // EDIT YOUR DATA $data['segment_ids'] = array('a1b2c3d4e5f6'); return $data; }
and my CF7 array shows as follows:
{ "first_name": "??????", "last_name": "??????", "tel_number": "??????", "email": "??????", "TrainingLocation": "??????", "msg-notes": "??????", "optin_ip": "??????", "segment_ids": "??????" }
The user get’s added to Flodesk but doesn’t get added to any segment.
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskHi Mario,
Thank you for the update! I’m sure many will benefit from it. With regards to my final issue – sending the Segment ID as an Array. I was thinking of using another solution as I didn’t understand the example you gave – unfortunately i’m not very good with PHP.
I was thinking this one – https://www.ads-software.com/support/topic/radio-button-and-checkboxes-empty-in-zapier/
Would you be able to help me with what I need to add? In my postman example, the ‘segments_ids’ field has to be sent like this within the array:
{ “segment_ids”: [“segement_id_number”] }
It’s strange that it’s not a string field but I have contacted Flodesk’s dev team and I am awaiting a reply. Using Microsoft Flow works but would be good to sort natively via the WP plugin.
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskI think I may have found the issue, the segments_id value which is used to place the user into a Segment has to be sent in Array not a string therefore it needs to be in this value
?“segment_ids”: [“segment_id_here”]
Is there a quick way to do this? I will take a look in the forums to see if I can figure it out.
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskHi Mario,
Thank you for your reply. I don’t seem to be able to get it to work. When I add the URL to Webhooks it strips out the { } brackets so I’ve amended the code provided to id_or_email and no luck.
It creates the user using first webhook but the second url the one with (id_or_email) doesn’t work. Any ideas? Would be good to natively implement but if not I have managed to leverage Power Automate to do what I need.
Forum: Plugins
In reply to: [CF7 to Webhook] Integrate with FlodeskHi Mario,
Apologies for the delay, I ended up using Zapier in the interim while I had some more time to investigate this. I have been playing around in postman to work on variables I need and I think I have everything now.
The only thing I wanted to check is to be able to add a user to a specific email segment I have to use the URL – /subscribers/{id_or_email}/segments; is it possible to feed the email address from the form and feed it as a variable into the Webhook URL field?
Thanks