PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
	All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™











add_action( 'ws_plugin__s2member_during_handle_profile_modifications','function_ws_plugin__s2member_during_handle_profile_modifications', 10, 1);
function function_ws_plugin__s2member_during_handle_profile_modifications($a)
{
    include_once $_SERVER['DOCUMENT_ROOT']."/feature/wp-content/plugins/s2member/includes/_xtnls/mailchimp/nc-mcapi.inc.php";
    $mcapi = new NC_MCAPI ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"], true); 
    $mailchimp = array ("function" => __FUNCTION__, "func_get_args" => $a["_p"], "api_method" => "listUpdateMember");
    $mailchimp["list_id"] = "08e278e7b0";
    $email = $a["current_user"]->data->user_email;;
    $my_custom_elements = array(
        'MERGE0' => $a["_p"]["ws_plugin__s2member_profile_email"],
        'MERGE1' => $a["_p"]["ws_plugin__s2member_profile_first_name"],
        'MERGE2' => $a["_p"]["ws_plugin__s2member_profile_last_name"],
        'MERGE3' => $a["_p"]["ws_plugin__s2member_profile_merge3"],     //Job title
        'MERGE4' => $a["_p"]["ws_plugin__s2member_profile_merge4"],        //Organization Name
        'MERGE5' => $a["_p"]["ws_plugin__s2member_profile_merge5"],        //address1
        'MERGE6' => $a["_p"]["ws_plugin__s2member_profile_merge6"],        //address2
        'MERGE7' => $a["_p"]["ws_plugin__s2member_profile_merge7"],        //city
        'MERGE8' => $a["_p"]["ws_plugin__s2member_profile_merge8"],        //state
        'MERGE9' => $a["_p"]["ws_plugin__s2member_profile_merge9"],        //zip
        'MERGE10' => $a["_p"]["ws_plugin__s2member_profile_merge10"],        //phone
        'MERGE13' => $a["_p"]["ws_plugin__s2member_profile_merge13"]        //country
    );
    $mailchimp["merge_array"] = $my_custom_elements;
    $mailchimp["api_response"] = $mcapi->{$mailchimp["api_method"]}($mailchimp["list_id"], $email, $mailchimp["merge_array"], "html", false); 
     $mailchimp["api_success"] = $success = true; 
    $mailchimp["api_properties"] = $mcapi; 
//    echo "<pre>";    print_r($mailchimp);echo "</pre>";
    
} 

Users browsing this forum: Google [Bot] and 1 guest