Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration
You are here: Home

GarSEO

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • March 28, 2018 at 1:39 pm in reply to: eMember – how to set the variables to pass the data to getresponse #77602
    GarSEO
    Member

    That is the entire code section for the eMember_getResponse_subscribe” function:

    passwort is the german word for password

    function eMember_getResponse_subscribe($campaign_name, $fname, $lname, $email_to_subscribe, $user_name, $wp_emember_NexusGlobal_SponsorID, $wp_emember_pwd) {

    eMember_log_debug(‘Attempting to call GetResponse API for list signup…’, true);

    $emember_config = Emember_Config::getInstance();

    $api_key = $emember_config->getValue(‘eMember_getResponse_api_key’);

    // API 2.x URL

    $api_url = ‘http://api2.getresponse.com’;

    $customer_name = $fname . ” ” . $lname;

    eMember_log_debug(‘API Key:’ . $api_key . ‘, Customer name:’ . $customer_name, true);

    // initialize JSON-RPC client

    include_once(‘lib/auto-responder/eMember_jsonRPCClient.php’);

    $client = new eMember_jsonRPCClient($api_url);

    $result = NULL;

    eMember_log_debug(‘Attempting to retrieve campaigns for ‘ . $campaign_name, true);

    if (empty($campaign_name)) {

    eMember_log_debug(‘Getresponse campaign name is empty. This signup request will be ignored.’, true);

    return;

    }

    $result = $client->get_campaigns(

    $api_key, array(

    # find by name literally

    ‘name’ => array(‘EQUALS’ => $campaign_name)

    )

    );

    # uncomment this line to preview data structure

    # print_r($result);

    # since there can be only one campaign of this name

    # first key is the CAMPAIGN_ID you need

    $CAMPAIGN_ID = array_pop(array_keys($result));

    eMember_log_debug(“Attempting GetResponse add contact operation for campaign ID: ” . $CAMPAIGN_ID . ” Name: ” . $customer_name . ” Email: ” . $email_to_subscribe . ” username_gut: ” . $user_name . ” sponsorid_ng: ” . $wp_emember_NexusGlobal_SponsorID . ” passwort_gut: ” . $wp_emember_pwd, true);

    if (empty($CAMPAIGN_ID)) {

    eMember_log_debug(“Could not retrieve campaign ID. Please double check your GetResponse Campaign Name:” . $campaign_name, false);

    } else {

    # add contact to the specified campaign

    try {

    $result = $client->add_contact(

    $api_key, array(

    ‘campaign’ => $CAMPAIGN_ID,

    ‘name’ => $customer_name,

    ’email’ => $email_to_subscribe,

    ‘cycle_day’ => ‘0’,

    ‘username_gut’ => $user_name,

    ‘sponsorid_ng’ => $wp_emember_NexusGlobal_SponsorID,

    ‘passwort_gut’ => $wp_emember_pwd,

    )

    );

    } catch (Exception $e) {

    //eMember_log_debug_array($e,false);//Show this to see the details of the exception and failure

    eMember_log_debug(“Getresponse add_contact operation failed for email: ” . $email_to_subscribe, false);

    return false;

    }

    }

    # uncomment this line to preview data structure

    print_r($result);

    eMember_log_debug(“GetResponse contact added… result:” . $result, true);

    return true;

    }

  • Author
    Posts
Viewing 1 post (of 1 total)

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ