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™

CCAPS and MailChimp

s2Member Plugin. A Membership plugin for WordPress®.

CCAPS and MailChimp

Postby cassel » October 26th, 2011, 9:44 pm

I have asked many questions, and Cristian and Jason have been very patient with me, but now, i am getting confused and i think i am getting my developper scratching his head!

I have s2M and use ccaps (currently, i have 2 products but might get a couple more in the future). I am also using MailChimp as it integrates nicely. But that is where the "problems" arrive.

If i want to use ONE single list in MC, and use their flexible segmentation feature, i have to get s2M to incorporate the different ccaps or product name (or whatever identifies the different products) into merge field. This is not readily available, from what i understand but Jason gave a workaround in this thread:
viewtopic.php?f=4&t=14727&p=33399
However, information is NOT updated if the member's status changes, but only when they register, so what if the member purchases 2 products? It might not be accurate on the list.

If i want to use MULTIPLE lists (one for all, one for everyone who purchased, one for those who purchased product A, one for those who purchased product B, etc.). It seems that answer would be in this thread:
viewtopic.php?f=4&t=15345 but then, as i asked the support staff at MailChimp, if one person unsubscribes from the unsubscribe email link of an email, they might not be removed from all the lists they are on, and therefore might still get emails from another list and place a complaint. My developper says it is possible to have all instances of the member's listing removed from all the lists at once because of how s2M works. Support at MC didn't know enough about s2M to think so. And in any case, if the information is still not changed when the member's status changes, i am stuck.

So, since i am that confused, since there is not obvious simple way to manage multiple fields/lists to match different ccaps/products, and no guarantees that the status of the member (therefore any merged field in MC) is updated, what would you suggest? Wait until s2M integrates those?

I really dont want to ask my developper to work on something that would work only halfway because of some limitations of either MC or s2M, nor work on something that would be fully integrated in a next s2M update, etc. That is why, he is scratching his head right now. I cannot make up my mind, but i feel like there is not ONE clear cut solution. What do you think? What would you suggest?
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby Cristián Lávaque » October 27th, 2011, 4:59 pm

You could try using the Notifications API to add new merge fields based on custom capabilities to MailChimp. Has your developer looked into that?
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: CCAPS and MailChimp

Postby cassel » October 27th, 2011, 5:42 pm

I am pretty sure he looked into it as he said it was possible, but at this time, if the status of a member changes in WP/s2M say, from level0 to level1, or from Level1 with ccapsA to Level1 with ccapsB, is not taken into account by s2Member, how could it be managed in MC? Maybe i should wait until that is integrated in s2M?
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby cassel » October 30th, 2011, 8:56 pm

If a member's status changes from free member to paid member or from member who bought product A to member who bought product B, does it automatically change with s2M? I think i remember that it will update for "fresh and new" registrations but not for "older" one. Am i correct?
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby Jason Caldwell » October 31st, 2011, 11:44 am

Thanks for the heads up on this thread.
cassel wrote:I am pretty sure he looked into it as he said it was possible, but at this time, if the status of a member changes in WP/s2M say, from level0 to level1, or from Level1 with ccapsA to Level1 with ccapsB, is not taken into account by s2Member, how could it be managed in MC? Maybe i should wait until that is integrated in s2M?
Yea, the Notifications API and/or the Filter method that I posted here is what I'd use for now. I would go ahead and implement one or both of these, so that you can use segmentation based on whatever extra data you need ( i.e. Custom Capabilities, or something else perhaps ).

As for Profile updates, this is something that we're working on already, so I'd hold off on that to prevent your developer from working on something that we're already dealing with. But custom MERGE fields, is not something that we're planning to add a UI panel for anytime soon though ( perhaps in the future, but not right away ), so that part I'd have your developer work on, using the Filters provided by s2Member. That's something that is usually VERY custom anyway; so that part I recommend custom code for.

s2Member® / Hot Tip: ( s2Installs.com! )

Recommended by s2Member® Lead Developer (Jason Caldwell). Their rate for a standard installation is $125. They're highly trained. Just request their service!

Need Help? Post A New Job!

It's free. Your Job will appear here, and @ jobs.wordpress.net. It will be displayed for a period of 21 days; or until you take it off, whichever comes first. Good luck!

For the benefit of other developers...
please note that s2Member makes several Hooks/Filters available throughout its framework.

In the case of MailChimp, I recommend taking a look at the Filters available here:
s2Member source code: viewtopic.php?f=40&t=13018&src_doc_v=111029#src_doc_line_118
( to understand how these work, see: http://apidocs.mailchimp.com/api/1.3/li ... e.func.php )

s2Member source code: viewtopic.php?f=40&t=13018&src_doc_v=111029#src_doc_line_238
( to understand how these work, see: http://apidocs.mailchimp.com/api/1.3/li ... e.func.php )
~ 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: CCAPS and MailChimp

Postby cassel » October 31st, 2011, 11:58 am

I might be dense, but one little detail is still unclear. When you talk about custom MERGE field, are you refering to the adjusting the current list(s)? because if i have a custom MERGE field and new members will have it filled and already-members wont, then it defeats the purpose, doesn`t it?

So, in my case,
- i can either use that detailed explanation you gave to CONVERT my current list(s) here: viewtopic.php?f=4&t=15345
- to set up the future new members, i will be using the hack you suggest in that thread here : viewtopic.php?f=4&t=10148&p=20994#p20994
- for existing members adding a new product (or changing level), this will be addressed in a future release

Is that it? Am i understanding correctly? (you are all so patient with non-techies like me!)
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby Jason Caldwell » October 31st, 2011, 1:07 pm

Well, MERGE tags/fields for MailChimp can be useful in a variety of situations. In the context of s2Member, we're talking about MERGE fields that give MailChimp more information about each User/Member on your WordPress-powered site.

By default, s2Member sends MailChimp the First/Last Name, Email, IP Address, and Timestamp for each User/Member. These are the default MERGE fields that are configured for each list at MailChimp. s2Member integrates in this default way as well. If s2Member were to attempt to send other details/information about each User/Member without you having first configured new MERGE fields for your list, then API calls to MailChimp, by s2Member would fail, because s2Member would be sending data to MailChimp that it is NOT yet configured to receive.

This is where adding custom MERGE fields comes in. If, for example, you wanted MailChimp to know the Membership Level and/or Custom Capabilities associated with each of your Users/Members, you could use the code samples I've provided in various posts throughout our forum here. I'll go ahead and post another code sample here to achieve what I've just mentioned.


You will probably want to seek assistance from a developer to complete this, but none the less, here is a quick example for you. This examples shows how you might add custom MERGE fields into the existing defaults that s2Member already supplies with each call to the MailChimp API.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter
("ws_plugin__s2member_mailchimp_merge_array", "my_filter"102);
function my_filter($merge, $vars)
    {
// $merge /* Array of existing MERGE fields that s2Member passes by default. */
// $vars /* Array of defined variables in the scope/context of this Filter. */

        $user_id = $vars["user_id"];
        // print_r($vars); // Lots of good stuff in this array.

        $user_level = get_user_field("s2member_access_level", $user_id);
        $user_role = get_user_field("s2member_access_role", $user_id);
        $user_ccaps = implode(",",get_user_field("s2member_access_ccaps", $user_id));

        $my_custom_merge_vars = array("S2_LEVEL" => $user_level, "S2_ROLE" => $user_role, "S2_CCAPS" => $user_ccaps);

        return array_merge($merge, $my_custom_merge_vars);
    }
?>
* Based on this example, you would first need to add new MERGE fields to your MailChimp list, giving the names: S2_LEVEL,S2_ROLE,S2_CCAPS. See also this s2Member API Function: get_user_field(), which might be helpful when collecting certain details about a User/Member: viewtopic.php?f=40&t=12453&src_doc_v=111029#src_doc_get_user_field%28%29


How you make use of those MERGE fields at MailChimp is completely up to you. Some site owners use them to segment their list ( i.e. they have just ONE list, and they mail to that list based on segmentations, which might be based on data in MERGE fields they've collected ). Or, sometimes MERGE fields are simply used to further personalize email messages that go out to your list subscribers. The possibilities with this are endless really. Whether you need this type of integration, or not, is hard to say. It just depends on what you're trying to accomplish at MailChimp. You are correct though, Profile updates currently do NOT remain in-sync at MailChimp. These MERGE fields are only sent to MailChimp during registration. This is something we're working to make possible though.
~ 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: CCAPS and MailChimp

Postby cassel » October 31st, 2011, 1:19 pm

Please, dont scratch your head over me. Your explanation is clear. I think it is my own questions that are not. Is s2Member sending that information only upon first registration (in which case, it is pretty straightforward), or also upon update of the member`s status (either going from level0 to level1, or by purchasing a second product which would mean an added ccaps)?

I remember one thread where it was said that s2M was behaving somehwat differently in case of a change in member`s status, as opposed to registering a brand new member. That is the part that i am unsure about. I think i understand that it is that part that is being worked on now, for s2M and that i should NOT ask the developper.

*ducks now*
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby Jason Caldwell » October 31st, 2011, 2:07 pm

Not a problem.
I appreciate the great questions, and I'm sure others do as well.


I believe you're referring to this optional s2Member feature ( click to enlarge )
SNAG-0092.png

So how does this affect custom MERGE fields?
List transitioning removes a User/Member from one list, and then adds them to a new list configured at the new Membership Level they're being transitioned to. So, if you're running just ONE list ( and using custom MERGE fields to segment that list in some way ), you would configure s2Member with the same List ID at different Membership Levels. Then, you may choose to enable Automatic List Transitioning ( as seen in the screenshot above ). So now, when a User/Member is transitioned, s2Member will remove them from your MailChimp List, and then add them back in to the same list they were on before, but now with the new details ( possibly with new custom MERGE field values; i.e. if some of the information you're collecting changed, like they're Role or Membership Level Number ).

In short, your custom code is applied during Registration, and then re-applied when/if a User/Member is transitioned by s2Member, based on your configuration ( as seen in the screenshot above ).

Jason Caldwell wrote:
Code: Select all
<?php
add_filter
("ws_plugin__s2member_mailchimp_merge_array", "my_filter"102);
function my_filter($merge, $vars)
    {
// $merge /* Array of existing MERGE fields that s2Member passes by default. */
// $vars /* Array of defined variables in the scope/context of this Filter. */

        $user_id = $vars["user_id"];
        // print_r($vars); // Lots of good stuff in this array.

        $user_level = get_user_field("s2member_access_level", $user_id);
        $user_role = get_user_field("s2member_access_role", $user_id);
        $user_ccaps = implode(",",get_user_field("s2member_access_ccaps", $user_id));

        $my_custom_merge_vars = array("S2_LEVEL" => $user_level, "S2_ROLE" => $user_role, "S2_CCAPS" => $user_ccaps);

        return array_merge($merge, $my_custom_merge_vars);
    }
?>

SNAG-0093.png
~ 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: CCAPS and MailChimp

Postby cassel » October 31st, 2011, 2:25 pm

I think i am much closer to understand. Maybe my next detail has to do with MailChimp instead of s2M but i`ll ask anyways.

If i want to use ONE list, and as a merge field i have something like "Course registered", i remember that in MC, one field can have choices instead of just a yes or no. So if i have choices like Course A and Course B and Course C, if a member has registered for CourseA last week, and this week registers to CourseB, will BOTH be entered or will the second one overwrite the first one? I am refering to this phrase "...and then add them back in to the same list they were on before, but now with the new details ", so will it ADD the CourseB to CourseA in the MERGE field or replace it?

I think this is the part where i remember the explanation that s2M is not handling multiple products very well (like the EOT) so i was wondering how it could get MC to handle it (if it could).
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby Jason Caldwell » October 31st, 2011, 6:53 pm

Thanks for the follow-up.
cassel wrote:If i want to use ONE list, and as a merge field i have something like "Course registered", i remember that in MC, one field can have choices instead of just a yes or no. So if i have choices like Course A and Course B and Course C, if a member has registered for CourseA last week, and this week registers to CourseB, will BOTH be entered or will the second one overwrite the first one? I am refering to this phrase "...and then add them back in to the same list they were on before, but now with the new details ", so will it ADD the CourseB to CourseA in the MERGE field or replace it?
No, when you fill MERGE fields with data from s2Member, you're dealing with string representations of pieces of data, and NOT with multiple choice options. So I wouldn't try synchronizing multiple choice options with s2Member in this way.

The MERGE fields, and/or custom MERGE fields that you create, which are filled by s2Member, should be related to data which s2Member is fully aware of ( e.g. something s2Member has on record in your WordPress database ). That way when s2Member adds them back into your list, it has all of the data that it needs to fill the MERGE field ( i.e. s2Member does not read previous entry-data and them add to or remove options ). s2Member simply fills in the MERGE field with whatever data string you've told it to ( i.e. via your custom code ).
~ 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: CCAPS and MailChimp

Postby cassel » October 31st, 2011, 7:07 pm

So, the only way to incorporate the possibility of having some members with ccaps1, others with ccaps2, and still more with ccaps1 AND 2 would be to have a MERGED field for 1, a MERGED field for 2, and so on, so that some will have a "yes" (or whatever) for product 1, and then can have an additional "yes" for product 2, without removing it from Product 1. Right? (i think i am getting there!)
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: CCAPS and MailChimp

Postby cassel » November 20th, 2011, 10:44 pm

As for Profile updates, this is something that we're working on already, so I'd hold off on that to prevent your developer from working on something that we're already dealing with.


Do you have any rough estimate of the timeline for that?
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 5 guests

cron