Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: Aegist on July 04, 2015, 08:12:46 PM

Title: SMF - Aweber Integration : I'm new to coding and struggling with it...
Post by: Aegist on July 04, 2015, 08:12:46 PM
Hi guys. I know I'm not the first person to try this, but I've also not seen anyway post anywhere a complete explanation for how to make it work, nor are there any mods out there to do it yet (though it seems like it would be a pretty easy mod to make...?? maybe?).

Anyway, I think I have got my head around what needs to be done thanks, ultimately to this guide (http://www.simplemachines.org/community/index.php?topic=453008.0) to setting up integration hooks, and this quick start API script (http://engineering.aweber.com/quick-start-api-script-in-php/) in the Aweber Labs. (There is another page in Aweber which gives you the code for adding new subscribers (https://labs.aweber.com/snippets/subscribers#cre), but it has an extra field for "account_id" and no explanation of where to find that, and since the quick start script already has a demonstration of adding a new subscriber in it, it seems like I won't need this 'add new subscriber code' - just mentioning it in case I am wrong about this assumption).

So, following the directions from those two halves of the equation, and it seems like I should just be able to just modify the quick start script so that it uses $regOptions['emailAddress'] and $regOptions['memberName'] instead, place that code within the function smf_register_function($regOptions, $theme_vars){} bit of the smf_2_integration_hooks.php file, and that should sign people up to aweber whenever they register, right?

Well, right or wrong, I can't even make the aweber script work at all when I try to run it in the forum/Source/ directory.

ie: when I use the aweber quick start script in my root directory, it works fine. But when I move it to the forum/Sources/ directory, it just stops working. I have made the require() call for the API file give the absolute location (I've tried several different techniques to do this, thinking that this would be the core problem), but that doesn't seem to help.

I am still learning to code, so this has been very challenging!

Help would be very very appreciated.

Thanks!
Title: Re: SMF - Aweber Integration : I'm new to coding and struggling with it...
Post by: Kindred on July 06, 2015, 11:21:44 AM
http://wiki.simplemachines.org/smf/Category:Integrating_SMF