Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

CF7 and mailchimp groups

$
0
0

Replies: 0

Hello,
I have CF7 installed. I want to pass on CF7’s email, first and last name fields to mc4wp. I am currently doing it through (CF7 code):

<label> Your  First Name:
    [text* mc4wp-FNAME id:name] </label>

<label> Your  Last Name:
    [text* mc4wp-LNAME id:name] </label>

<label> Your private email (in case your work email provider might block our emails):
 [email* mc4wp-EMAIL id:email]</label>

<label> Work email address:</label>
<label> (In case you are taking this course for work-related reasons)
 [email mc4wp-MMERGE3]</label>

Then, I wanted to display two checkboxes for my form that would sent the information from above fields to two different groups (called “Distance Learning group” and “Newsletter”) that are in one list. I used mc4wp’s form generator to derive this code that’s targeting those specific groups (using mc4wp’s article as a guide):
` <label>
<input name=”INTERESTS[603a671e7c][]” type=”checkbox” value=”788bcdf62f”> <span>Distance Learning group</span>
</label>

<label>
<input name=”INTERESTS[603a671e7c][]” type=”checkbox” value=”5838e75428″> <span>Newsletter</span>
</label>`
I have then, per article instructions added these lines to functions.php file in my theme:


add_action( 'comment_form', function() {
	?>
	<!-- Paste your groupings HTML here, replacing this line -->
	<?php
});

add_filter( 'mc4wp_integration_data', function( $vars ) {
	$vars['INTERESTS'] = isset( $_POST['INTERESTS'] ) ? $_POST['INTERESTS'] : array();
	return $vars;
});

add_filter( 'mailchimp_sync_user_data', function( $data, $user ) {
    $data['MERGETAG'] = $user->field_name;
    return $data;
}, 10, 2 );

I am not good with php, and I suppose the first segment has to be altered, but not sure how. Anyways, the information is not passed down to mailchimp.
Example registration page (please type “test” in the first name field if you are going to submit it):http://elearningtoflourish.com/index.php/ss1201-registration-page/
Thanks
Update: even if I paste the html code (middle code segment) into the last php code segment where it says so, it still does not work.
Thanks


Viewing all articles
Browse latest Browse all 59525

Trending Articles