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.

MailChimp and custom capabilities

Home Forums Community Forum MailChimp and custom capabilities

This topic contains 1 reply, has 2 voices. Last updated by  Bruce 3 years, 6 months ago.

Topic Author Topic
Posted: Monday Jul 8th, 2013 at 8:44 pm #53135
Sonia
Username: nudge

Hello,

I’m using this snippet to send my custom capability “tags” to a merge field in MailChimp:

add_filter ("ws_plugin__s2member_mailchimp_merge_array", "s2_ccaps_merge", 10, 2);
function s2_ccaps_merge ($merge = array (), $vars = array ())
    {
        return array_merge ($merge, array ("MMERGE3" => $vars["ccaps"]));
    }

This is working beautifully, however I’m now trying to get each of my custom capability to show up under their own separate MailChimp merge field instead. I have four in total.

Can someone point me in the right direction?

Thanks!

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Wednesday Jul 10th, 2013 at 8:18 am #53218
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

I suppose you’d try something like this:

add_filter ("ws_plugin__s2member_mailchimp_merge_array", "s2_ccaps_merge", 10, 2);
function s2_ccaps_merge ($merge = array (), $vars = array ())
	{
		if(in_array('ccap1', $vars['ccaps']))
			return array_merge ($merge, array ('CUSTOM_CAPABILITY_1' => 'ccap1'));
	        	
		if(in_array('ccap2', $vars['ccaps']))
			return array_merge ($merge, array ('CUSTOM_CAPABILITY_2' => 'ccap2'));
	        	
		if(in_array('ccap3', $vars['ccaps']))
			return array_merge ($merge, array ('CUSTOM_CAPABILITY_3' => 'ccap3'));
	}

Here’s a thread where something similar was being done:

http://www.s2member.com/forums/topic/registration-wont-update-mailchimp-merge-tags/

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.