GetResponse Integration problem

Home Forums Quform WordPress GetResponse Integration problem

This topic is: not resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #31578
    BlueWind
    Participant

    Hello,

    I want to integrate my form with getresponse platform. I made everything from this tutorial:

    GetResponse

    Plugin is installed correctly. The problem is that when i submit form i have got standard quform confirmation but the submission do not add to getresponse list.

    Waiting for your ideas,

    The test form is here: http://test.obroncy.org.pl

    Greet,
    Lucas

    #31579
    BlueWind
    Participant

    This is how look like my ‘quform-getresponse.php ‘ file.

    <?php

    /*
    * Plugin Name: Quform GetResponse Integration
    * Description: Add contacts to GetResponse from Quform forms.
    * Version: 1.0
    */

    add_filter(‘quform_post_process_1’, function (array $result, Quform_Form $form)
    {
    if (!class_exists(‘GetResponse’)) {
    require_once dirname(__FILE__) . ‘/GetResponseAPI3.class.php’;
    }

    $getresponse = new GetResponse(‘myapikey’);

    try {
    $result = $getresponse->addContact(array(
    ‘name’ => $form->getValueText(‘quform_1_3′),
    ’email’ => $form->getValue(‘quform_1_4’),
    ‘campaign’ => array(
    ‘campaignId’ => ‘BX3mx’
    ),
    ‘ipAddress’ => Quform::getClientIp()
    ));
    } catch (Exception $e) {
    if (defined(‘WP_DEBUG’) && WP_DEBUG) {
    Quform::log($e);
    }
    }

    return $result;
    }, 10, 2);

    #31585
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31588
    BlueWind
    Participant

    Hello Ally,

    Thank you for help. Ok, I solve the problem. There was same extra space in code.

    information from log:

    PHP Parse error: syntax error, unexpected ‘campaign’ (T_STRING), expecting ‘,’ or ‘)’ in /home/users//wp-content/plugins/quform-getresponse/quform-getresponse.php on line 21

    I have one more question to this plugin. I have two forms on one website and I want to add submissions from each form to different campaigns.
    I duplicate code in ‘quform-getresponse.php’ file and change campain token, but it doesnt work correctly. Sometimes it add sumbission to two different getresponse campaigns, sometime not. How do you think i can do it in a different way?

    The file look now like this

    ‘<abbr>’
    <?php

    /*
    * Plugin Name: Quform GetResponse Integration
    * Description: Add contacts to GetResponse from Quform forms.
    * Version: 1.0
    */

    add_filter(‘quform_post_process_1’, function (array $result, Quform_Form $form)
    {
    if (!class_exists(‘GetResponse’)) {
    require_once dirname(__FILE__) . ‘/GetResponseAPI3.class.php’;
    }

    $getresponse = new GetResponse(‘myapikey’);

    try {
    $result = $getresponse->addContact(array(
    ‘name’ => $form->getValueText(‘quform_1_13′),
    ’email’ => $form->getValue(‘quform_1_4’),
    ‘campaign’ => array(
    ‘campaignId’ => ‘BX3mx’),
    ‘ipAddress’ => Quform::getClientIp()
    ));
    } catch (Exception $e) {
    if (defined(‘WP_DEBUG’) && WP_DEBUG) {
    Quform::log($e);
    }
    }

    return $result;
    }, 10, 2);

    add_filter(‘quform_post_process_2’, function (array $result, Quform_Form $form)
    {
    if (!class_exists(‘GetResponse’)) {
    require_once dirname(__FILE__) . ‘/GetResponseAPI3.class.php’;
    }

    $getresponse = new GetResponse(‘myapikey’);

    try {
    $result = $getresponse->addContact(array(
    ‘name’ => $form->getValueText(‘quform_2_13′),
    ’email’ => $form->getValue(‘quform_2_4’),
    ‘campaign’ => array(
    ‘campaignId’ => ‘BX32C’),
    ‘ipAddress’ => Quform::getClientIp()
    ));
    } catch (Exception $e) {
    if (defined(‘WP_DEBUG’) && WP_DEBUG) {
    Quform::log($e);
    }
    }

    return $result;
    }, 10, 2);

    ‘</abbr> ‘

    Attachments:
    You must be logged in to view attached files.
    #31597
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy