• hello everyone, i am trying to connect c7 with keila.io (newsletter tool). keila needs the data in the following form:

    {
    “data”:
    {
    “email”: “foo2@example.com”,
    “last_name”: “mustermann”
    }
    }

    (https://app.keila.io/api#/Contacts/KeilaWeb.ApiContactController.index)

    cf7 plus webhook send this:
    {
    “email”: “foo2@example.com”,
    “last_name”: “mustermann”
    }

    So I need this
    {
    “data”:

    }

    to “enclose” the actual data

    is that possible?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hey. How are you?

    Sure, but you will need some code.
    Please, check this: Change data before send.

    In your case, this snippet should work:

    add_filter( 'ctz_get_data_from_contact_form', 'example_ctz_get_data_from_contact_form' );

    function example_ctz_get_data_from_contact_form( $data ) {
    return [ 'data' => $data ];
    }

    Let me know if you need help to achieve this.

    Thread Starter heino18berlin

    (@heino18berlin)

    Hey Mario, thank you for your information 😉

    Where should I insert this code?

    best from Berlin // Heino

    Plugin Author Mário Valney

    (@mariovalney)

    Plugin Author Mário Valney

    (@mariovalney)

    PLEASE MAKE A BACKUP AND/OR CHECK IT IN A NON LIVE SITE

    Your plugin code:

    <?php
    /**
    *
    * Plugin Name: CF7 to Webhook - Keila Support
    * Description: Format data to send a webhook to keila.io
    * Version: 1.0.0
    * Author: Mário Valney and Berlin // Heino
    * Author URI: https://mariovalney.com
    * Text Domain: cf7-to-webhook-discord-integration
    *
    */

    add_filter( 'ctz_get_data_from_contact_form', 'heino_ctz_get_data_from_contact_form' );

    function heino_ctz_get_data_from_contact_form( $data ) {
    return [ 'data' => $data ];
    }

    You can save it with cf7-keila.php name in a directory called cf7-keila and zip it.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘connect to keila.io API’ is closed to new replies.