• Resolved bluesoul81

    (@bluesoul81)


    Hi,

    First of all thanks for a great plugin.

    I have some dynamic pages, and i want to display the susbcription form on those pages. In mailing list i have 30+ interests. I can manually check one interest and display the form. But i am unable to understand how to aply some filter to pass interest of current page to form interest field.

    Any help on this please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Tracy Levesque

    (@liljimmi)

    ?????? YIKES, Inc. Co-Owner

    Hello.

    We do have some dynamic tags you can use in a field to grab data from the page:

    Page Title
    Page ID
    Page URL
    Blog Name
    User Logged In

    However, none of those are connected to a MailChimp interest group.

    I will see if anyone has an idea of how one of those values could connect to an interest group field and check it.

    Thank you!
    -Tracy

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @bluesoul81,

    Just want you to know I am looking into this; I hope to have some type of solution by tomorrow.

    Kevin.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @bluesoul81,

    First, is there some attribute on a page that defines what interest group it is related to? We need to find a way to map the current page to the interest group. Once we have that, we can add a filter (and I can help you with that if you need).

    For example, in my environment I added a hook that adds every subscriber of a certain form to a checkbox interest group. The add_filter line looks like:
    add_filter( 'yikes-mailchimp-before-submission-2', 'mc_test_add_subcribers_to_interest_group', 10, 1 );.
    Every time my form (with an ID of 2) is submitted, I call the mc_test_add_subcribers_to_interest_group function. This function looks like this:

    function mc_test_add_subcribers_to_interest_group( $form_data ) {
    
    	// Add all subscribers to interest group 679, subgroup 1
    	$form_data['groupings'] = array(
    		array(
    			'id' => 679,
    			'groups' => array(
    				'Group 1'
    			)
    		)
    	);
    
    	return $form_data;
    }

    (Note that this function is hardcoded, and would need to be more robust for your purposes).

    Hope that helps, let me know if you have questions,
    Kevin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Passing Default Interest from Current Page’ is closed to new replies.