Forums

Chronoforms and aweber

marklandry 11 Nov, 2013
Hi,
I followed your aweber faq here http://www.chronoengine.com/faqs/4050-how-can-i-send-form-results-to-aweber.html but can't seem to get this to work.

I get nothing in the debug area after form submission indicating that anything happened, and my tests aren't added to the list.

Not sure where to go from here...

The form can be accessed here http://jacquifit.com/index.php?option=com_chronoforms&tmpl=component&chronoform=aweber-opt-in

I have the following in a custom code event in "on submit" after emails:
[code]
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

// set $debug = true to generate diagnostic output
$debug = true;

// this is file is from the AWeber Developer Lab
include JPATH_SITE.DS.'components'.DS.'com_chronoforms'.DS.'extras'.DS.'aweber_api'.DS.'aweber_api.php';

// Replace with the keys of your application
// NEVER SHARE OR DISTRIBUTE YOUR APPLICATIONS'S KEYS!
$consumerKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$consumerSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$accessTokenSecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$list_name = 'xxxxxxxxxxxx'; // put the AWeber List Name here

$aweber = new AWeberAPI( $consumerKey, $consumerSecret );
$account = $aweber->getAccount( $accessToken, $accessTokenSecret );

// set this to true to view the actual api request and response
if ( $debug ) $aweber->adapter->debug = true;

try {
// get the list object for the named list
$foundLists = $account->lists->find( array( 'name' => $list_name ) );
$list = $foundLists[0];

// create a subscriber
$params = array(
'email' => $form->data['email'],
'name' => $form->data['name'
);
$subscribers = $list->subscribers;
$new_subscriber = $subscribers->create( $params );
// success!
if ( $debug ) print "A new subscriber was added to the $list->name list!";
} catch( AWeberAPIException $exc ) {
if ( $debug ) {
print "<h3>AWeberAPIException:</h3>";
print " <li> Type: $exc->type <br>";
print " <li> Msg : $exc->message <br>";
print " <li> Docs: $exc->documentation_url <br>";
print "<hr>";
}
}
?>
[/code]



I'm sure I'm missing something...

Thanx.

Mark
GreyHead 13 Nov, 2013
Hi Mark,

The Thank You page shows a 500 Server Error - but no explanation.

If this is Joomla! 3 then .DS. has been deprecated - replace with / as
include JPATH_SITE.'/components/com_chronoforms/extras/aweber_api/aweber_api.php';


I assume that you have the api files in this folder and that the keys are valid in the real version? That is you've been though the game of getting valid OAuth keys?

I'd set Site Debugging temporarily to Maximum and try commenting out the end two thirds of the code and adding some debug 'variable dumps' to see if I can get some output.

Bob
This topic is locked and no more replies can be posted.