Hi, I’m using a silent subscription hack to silently subscribe some users to Mailchimp on registration. I’m also using a merge array filter to pass on custom fields (such as birthday and other details) to mailchimp – http://www.primothemes.com/forums/viewtopic.php?p=20994#p20994 .
I’m having trouble retrieving the custom s2member registration fields. Here is my s2-hacks.php code:
add_filter("ws_plugin__s2member_mailchimp_double_optin", "__return_false");
add_filter('ws_plugin__s2member_mailchimp_merge_array', 'mailchimp_merge', 10, 2);
function mailchimp_merge($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. */
//print_r($vars); // Lots of good stuff in this array.
$user_id = $vars['user_id'];
$cfields = get_user_option('wp_s2member_custom_fields', $user_id);
return array_merge($merge, array('USER_ID' => $user_id, 'MERGE3' => $cfields['province'], 'MERGE4' => $cfields['two'], 'MERGE5' => date("m/d/Y")));
}
Looking at mailchimp log, MERGE3 and MERGE4 come through as null.
Thanks,
-
This topic was modified 4 years, 1 month ago by Alex Read.
-
This topic was modified 4 years, 1 month ago by Alex Read.