Home › Forums › Quform WordPress › GetResponse Integration problem
- This topic has 4 replies, 2 voices, and was last updated 4 years, 5 months ago by Ally.
- AuthorPosts
- June 26, 2020 at 4:34 pm #31578BlueWindParticipant
Hello,
I want to integrate my form with getresponse platform. I made everything from this tutorial:
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,
LucasJune 26, 2020 at 4:47 pm #31579BlueWindParticipantThis 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);June 30, 2020 at 10:44 am #31585AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 30, 2020 at 5:00 pm #31588BlueWindParticipantHello 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.July 1, 2020 at 10:46 am #31597AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.