This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Aweber Integration


  1. smoothjwm
    Member

    Hey,

    I want to do an application and have the user enter their email into the aweber database. Basicly after they submit it goes to aweber and send them an autoresponse. This is the code for aweber...

    <form action="http://www.aweber.com/scripts/addlead.pl" method="post">

    email... input code

    <input TYPE="TEXT" name="custom phone" SIZE="5">

    can I add this to a file so it will send me the form, post in the backoffce of Machform, and post to aweber with the email address?

    Thanks in advance.

    Posted 15 years ago #
  2. smoothjwm
    Member

    correction: <input TYPE="TEXT" name="from" SIZE="5"> ... if that matters

    Posted 15 years ago #
  3. yuniar

    Can you tell me what are the exact variables needed to post to aweber?
    I need to know the exact variable names.

    Or is there any doc or link for this? Sample?


    MachForm Founder

    Posted 15 years ago #
  4. smoothjwm
    Member

    Here is the exact optin form:

    <center><form method="post" action="http://www.aweber.com/scripts/addlead.pl">
    <input type="hidden" name="meta_web_form_id" value="377692644">
    <input type="hidden" name="meta_split_id" value="">
    <input type="hidden" name="unit" value="abunzaelite">
    <input type="hidden" name="redirect" value="http://www.mycelebritylifestyle.com/thanks.html" id="redirect_e3a540480d0b7614387f8d791fb79703">
    <input type="hidden" name="meta_redirect_onlist" value="http://www.mycelebritylifestyle.com/thanks.html">
    <input type="hidden" name="meta_adtracking" value="capture">
    <input type="hidden" name="meta_message" value="1">
    <input type="hidden" name="meta_required" value="from">
    <input type="hidden" name="meta_forward_vars" value="0">
    <table>
    <tr><td colspan=2><center></center></td></tr>
    <tr><td>Name:</td><td><input type="text" name="name" value="" size="20"></td></tr>
    <tr><td>Phone:</td><td><input type="text" name="custom phone" value="" size="20"></td></tr>
    <tr><td>Email:</td><td><input type="text" name="from" value="" size="20"></td></tr>
    <tr><td colspan=2><center></center></td></tr>
    <tr><td align="center" colspan="2"><input type="submit" name="submit" value="Submit"></td></tr>
    </table>
    </form>
    </center>

    ------------------------------

    I just need it to simultaneously post normal in this, and post to the form in awber using the user's name & email. Is this possible?

    Posted 15 years ago #
  5. yuniar

    Ok, follow these steps:

    1) View the HTML source of your form and locate the id of your user's name and email field. Let say you have these:
    - Name : element_2
    - Email: element_3
    and your form id number is 5.

    2) Download HttpClient class from here:
    http://www.appnitro.com/files/HttpClient.class.zip

    Extract the zip package and upload the php file into your machform/lib folder.

    3) Edit your includes/post-functions.php file, search around line 1175 for this:

    if(empty($error_elements) && empty($process_result['custom_error'])){
    	$process_result['status'] = true;

    right below those lines, add this block of code:

    if($form_id == 5){
    	$target_url = 'http://www.aweber.com/scripts/addlead.pl';
    
    	$target_data['name'] 			= $table_data['element_2'];
    	$target_data['from'] 			= $table_data['element_3'];
    	$target_data['meta_web_form_id']	= '377692644';
    	$target_data['meta_split_id'] 		= '';
    	$target_data['unit'] 			= 'abunzaelite';
    	$target_data['redirect'] 		= 'http://www.mycelebritylifestyle.com/thanks.html';
    	$target_data['meta_redirect_onlist'] = 'http://www.mycelebritylifestyle.com/thanks.html';
    	$target_data['meta_adtracking'] 	= 'capture';
    	$target_data['meta_message'] 		= '1';
    	$target_data['meta_required'] 		= 'from';
    	$target_data['meta_forward_vars'] 	= '0';
    	$target_data['submit'] 			= 'Submit';
    
    	require 'lib/HttpClient.class.php';
    
    	HttpClient::quickPost($target_url, $target_data);
    
    }

    make sure to adjust form_id and element_id number above with your own form values.

    More info about HttpClient:
    http://scripts.incutio.com/httpclient/

    =======================================================

    Another alternative, if somehow your website doesn't support HttpClient, is using cURL library.
    Follow these steps instead:

    1) View the HTML source of your form and locate the id of your user's name and email field. Let say you have these:
    - Name : element_2
    - Email: element_3
    and your form id number is 5.

    2) Download curl helper file from here:
    http://www.appnitro.com/files/curl_helper.zip

    Extract the zip package and upload the php file into your machform/lib folder.

    3) Edit your includes/post-functions.php file, search around line 1175 for this:

    if(empty($error_elements) && empty($process_result['custom_error'])){
    	$process_result['status'] = true;

    right below those lines, add this block of code:

    if($form_id == 5){
    	$target_url = 'http://www.aweber.com/scripts/addlead.pl';
    
    	$target_data['name'] 			= $table_data['element_2'];
    	$target_data['from'] 			= $table_data['element_3'];
    	$target_data['meta_web_form_id']	= '377692644';
    	$target_data['meta_split_id'] 		= '';
    	$target_data['unit'] 			= 'abunzaelite';
    	$target_data['redirect'] 		= 'http://www.mycelebritylifestyle.com/thanks.html';
    	$target_data['meta_redirect_onlist'] = 'http://www.mycelebritylifestyle.com/thanks.html';
    	$target_data['meta_adtracking'] 	= 'capture';
    	$target_data['meta_message'] 		= '1';
    	$target_data['meta_required'] 		= 'from';
    	$target_data['meta_forward_vars'] 	= '0';
    	$target_data['submit'] 			= 'Submit';
    
    	require 'lib/curl_helper.php';
    
    	curl_post($target_url,$target_data);
    
    }

    make sure to adjust form_id and element_id number above with your own form values.


    MachForm Founder

    Posted 15 years ago #
  6. mig2000
    Member

    smoothjwm,

    Please let us know if this works out for you. I like to do something like this for our form as well. Also, I like to know if you are going to use aweber auto responder, why don't you use the machform?

    Thanks
    Alex

    Posted 15 years ago #
  7. yuniar

    We've tested the above code with Aweber and it worked indeed.

    However, the code posted above is for one form indeed. To use it for multiple forms, you need to duplicate the whole block of code within the "includes/post-functions.php".

    This code:

    if($form_id == 5){
    .....
    .....
    }

    Simply add another one like that and adjust the form_id number and parameters inside it.


    MachForm Founder

    Posted 15 years ago #
  8. jolynnbraley
    Member

    Hi, after following the above steps I've tested my form and after hitting "submit" I get the following errors:

    Warning: require(lib/HttpClient.class.php) [function.require]: failed to open stream: No such file or directory in /home1/thefitsh/public_html/machform/includes/post-functions.php on line 1233

    Fatal error: require() [function.require]: Failed opening required 'lib/HttpClient.class.php' (include_path='.:/usr/lib64/php:/usr/lib/php') in /home1/thefitsh/public_html/machform/includes/post-functions.php on line 1233

    The only thing I came up with was permissions but both the lib dir and the HttpClient are 755. What do I need to do to fix this? Thanks!

    Posted 14 years ago #
  9. yuniar

    It seems you are missing the HttpClient.class.php file.
    Are you sure you have extracted the zip file and upload it into your lib folder?


    MachForm Founder

    Posted 14 years ago #
  10. jolynnbraley
    Member

    Hi Yuniar, yes, it's there, machform/lib/HttpClient.class.php

    Posted 14 years ago #
  11. jolynnbraley
    Member

    Hi, I'm having a problem getting any data to pass to Aweber. I'm wondering if I need to have a form set up in Aweber with the same fields that I have created in my Machform, in order to pass all of that data to Aweber?

    OR, am I limited to passing Only the name and email to Aweber from my Machform?

    Posted 14 years ago #
  12. jolynnbraley
    Member

    To modify my last question....I'm ok with just passing the first name, last name, and email to Aweber, I don't have to pass the rest of my form data. I haven't been able to get the name and email over there though, and I verified that I'm not using an email that's already signed up to that list in Aweber.

    I've also turned off the machform review option. Thanks!

    Posted 14 years ago #
  13. yuniar

    Hi JoLynn,

    From your Aweber page, you should be able to generate a basic opt-in form as the above sample.

    You need to look into that form code and then use all the values there (most important is "meta_web_form_id")

    Adjust the code from my post above with your own Aweber form values, so that MachForm could submit it correctly.

    If you still having problem, you can reply to our last ticket and let me know your code. I'll check it again.


    MachForm Founder

    Posted 14 years ago #
  14. fourward
    Member

    Hi, I'm just wondering where can I find the form id of my form for the very first line of the above code?

    This bit:

    if($form_id == 5){

    Also where do I get the target data bits from? Is that the names of the fields in the HTML Salesforce form or the names of the fields in the MachForm?

    $target_data['name']

    Thanks!

    Posted 11 years ago #
  15. yuniar

    you can check the URL of your form and get the id number from there.

    For example, this form:
    http://www.appnitro.com/demo/view.php?id=3

    the above is having form id number 3.

    Regarding the target data bits, those are the names of the fields in the HTML code of your Salesforce forms indeed.


    MachForm Founder

    Posted 11 years ago #
  16. dhmedia
    Member

    We implemented this solution a few weeks ago before our largest tradeshow event of the year and it worked famously. Thanks for all your help!

    Posted 11 years ago #
  17. cjack
    Member

    How would this be inputted into the webhook panel using aweber ?

    Posted 8 years ago #
  18. yuniar

    @cjack -- the parameters are the same as above. here's an example:


    MachForm Founder

    Posted 8 years ago #

RSS feed for this topic

Reply