latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

My Custom Mailchimp Merge is NOT working…

Home Forums Community Forum Unofficial Extensions/Hacks My Custom Mailchimp Merge is NOT working…

Tagged: 

This topic contains 1 reply, has 1 voice. Last updated by  bigdookie 4 years ago.

Topic Author Topic
Posted: Wednesday Jan 2nd, 2013 at 7:10 pm #36030
bigdookie
Username: bigdookie

Hello all,

I am trying to have a custom field merge into mailchimp when the user subscribed to the site. The field is prepopulated with the current date and the date will be HIDDEN. I can prepopulate the date, but the field is not merging into mailchimp. Can someone take a look and help me out?

Thank You

< ?php
/*
Plugin Name: OvationPix Hacks
Plugin URI: http://ovationpix.com/
Description: Collection of hacks to customize plugins
Author: Rufas Wan
Version: 0.1
Author URI: https://plus.google.com/u/0/118400319415336869294/posts
*/
//—————————————————————-
// register custom CSS and JS
function hacks_cssjs(){
$deps = array(
'ws-plugin–s2member',
'RGForms'
);

wp_register_style('hacks-css', plugins_url('/hacks.css', __FILE__), $deps);
wp_enqueue_style('hacks-css');

wp_register_script('hacks-js', plugins_url('/hacks.js', __FILE__), $deps);
wp_enqueue_script('hacks-js');
}
add_action('wp_enqueue_scripts', 'hacks_cssjs');

//—————————————————————-
/* S2 Member */
// by default
add_filter("ws_plugin__s2member_mailchimp_double_optin", "__return_false");

// populate the custom field with today's date
function s2_default_date($vars = array())
{
$date = gmdate('j/m/Y');
$js = <<< _JS

jQuery(document).ready(function(){
jQuery(‘#ws-plugin–s2member-custom-reg-field-gadddate’).val(‘$date’);
jQuery(‘#ws-plugin–s2member-profile-gadddate’).val(‘$date’);
});

_JS;
echo $js;
}
add_action(“register_form”, “s2_default_date”, 2);
add_action(“show_user_profile”, “s2_default_date”, 2);

// submit to custom field to mailchimp acoount !!NOT WORKING!!
function s2_mailchimp($merge, $vars)
{
$user_id = $vars[‘user_id’];
$cfields = get_user_option(‘wp_s2member_custom_fields’, $user_id);
$my_custom_merge_vars = array(“GADDDATE” => $cfields[‘GADDDATE’]);
return array_merge($merge, $my_custom_merge_vars);
}
add_filter(“ws_plugin__s2member_mailchimp_merge_array”, “s2_mailchimp”, 10, 2);

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Friday Jan 4th, 2013 at 9:30 pm #36205
bigdookie
Username: bigdookie

nothing? :(

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.