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™

edition in "member profile" not updating mailchimp

s2Member Plugin. A Membership plugin for WordPress®.

edition in "member profile" not updating mailchimp

Postby Leinad » July 4th, 2011, 10:23 am

If I login into my site then change something in my member profile form the changes are updated within s2member, but no Mail-chimp

is this "by design"?
if so, what can I do to manually code it?
User avatar
Leinad
Registered User
Registered User
 
Posts: 11
Joined: June 22, 2011

Re: edition in "member profile" not updating mailchimp

Postby Cristián Lávaque » July 4th, 2011, 11:24 am

Have you told s2Member to update MailChimp when those changes happen? WP Admin -> s2Member -> API / List Server -> Automate Un-Subscribe/Opt-Outs :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: edition in "member profile" not updating mailchimp

Postby cassel » July 4th, 2011, 11:35 am

Willl that work only for un-subscribe/opt-outs or also for updates?
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: edition in "member profile" not updating mailchimp

Postby Cristián Lávaque » July 4th, 2011, 11:57 am

When an account's level changes on s2Member, it'll reflect on MailChimp depending on the integration you defined for levels-lists. Read the documentation there. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: edition in "member profile" not updating mailchimp

Postby cassel » July 4th, 2011, 12:02 pm

In the documentation there is a list of choices for "Process List Removals Automatically?". But instead of an account lever change, how about updating profile like email address? I dont see anything among the choices for that (unless it is not where it is supposed to show)
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: edition in "member profile" not updating mailchimp

Postby Cristián Lávaque » July 4th, 2011, 12:28 pm

I don't think that kind of updates are integrated yet. Although they don't happen often, I can understand it'd be wanted. I'll mention it to Jason.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: edition in "member profile" not updating mailchimp

Postby cassel » July 4th, 2011, 12:34 pm

I think it would be great since the login widget that comes with the pro version does offer the option to the user to change his profile including the email. Since everything else is integrated with MailChimp, it would be a nice way to tie it all together! (more work for Jason! lol)
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: edition in "member profile" not updating mailchimp

Postby Jason Caldwell » July 4th, 2011, 12:41 pm

Thanks for the great suggestion.
I'll see what I can do about this in a future release.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: edition in "member profile" not updating mailchimp

Postby Leinad » July 4th, 2011, 5:52 pm

hehe, that means that currently it's not possible :(
well, if my client wants it I'll post the code when is done, otherwise we'll wait for Jason's update :D
User avatar
Leinad
Registered User
Registered User
 
Posts: 11
Joined: June 22, 2011

Re: edition in "member profile" not updating mailchimp

Postby Leinad » July 5th, 2011, 11:29 am

hey Jason, it seems my client wants this, which means I have to code it myself :(
can you point me in the right direction as to what files you think they might be modified?

thank you very much :)
User avatar
Leinad
Registered User
Registered User
 
Posts: 11
Joined: June 22, 2011

Re: edition in "member profile" not updating mailchimp

Postby Jason Caldwell » July 5th, 2011, 7:04 pm

Gotchya. Thanks for the follow-up.

Yes, I would suggest this Hook for you.
ws_plugin__s2member_during_handle_profile_modifications

See: viewtopic.php?f=40&t=9605&src_doc_v=110605#src_doc_line_121
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: edition in "member profile" not updating mailchimp

Postby Leinad » July 6th, 2011, 3:56 pm

Ok, I've returned with a temporary solution, I just added an action to the hook "ws_plugin__s2member_during_handle_profile_modifications"
Just paste that code in mu-plugins/s2-hacks.php :)

Code: Select all
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>";
    
} 


Note that is still missing a lot of features and some parts are hard coded because I only need it for this site, something more general needs to use other global variables or better coding standards :P
Last edited by Cristián Lávaque on July 7th, 2011, 2:50 am, edited 2 times in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
Leinad
Registered User
Registered User
 
Posts: 11
Joined: June 22, 2011

Re: edition in "member profile" not updating mailchimp

Postby Jason Caldwell » July 8th, 2011, 3:31 pm

Thanks for sharing this.
~ MUCH appreciated!
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

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

cron