Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: GetResponse Integration problem #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.
    in reply to: GetResponse Integration problem #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);

Viewing 2 posts - 1 through 2 (of 2 total)
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy