Hi @ntel,
The code looks correct. Can you confirm that you’re using a text MERGE field and the MERGE tag is called SPORT?
Thank you,
Kevin.
Edit: this is a duplicate of https://wordpress.org/support/topic/insert-tags-into-forms-for-mailchimp-tagging/#post-10740588.
Thread Starter
ntel
(@ntel)
Hi Kevin, thank you very much for the answer. Referencing to the other thread, I’ll allow myself to continue on this one, because this is where I am closer to something interesting that actually can apply.
***
The following code:
function populate_SPORT_field( $user_data ) {
$user_data[‘SPORT’] = ‘baseball’;
return $user_data;
}
add_filter( ‘yikes-mailchimp-before-submission’ , ‘populate_SPORT_field’ );
Indeed doesn’t work in my functions.php, in spite of having precreated the field as a text field :/
In my case, even the code you give in the filter page (which I tried as a test):
function populate_FNAME_field( $user_data ) {
if( is_user_logged_in() ) {
if( isset( $user_data['FNAME'] ) ) {
get_currentuserinfo();
$user_data['FNAME'] = $current_user->user_firstname;
}
}
return $user_data;
}
add_filter( 'yikes-mailchimp-before-submission' , 'populate_FNAME_field' );
Unfortunately does not work either, in so far as it does not populate and/or update the filled first name of a user when s/he’s logged in.
I’ve been banging my head for 36 hours now :/ – one potential avenue I was thinking was using the prefilled, dynamically-generated default value of a hidden form that I noticed from Easy Forms, specifically {page_url}, and then parse this URL in a predefined segment within Mailchimp to extract the sport name…
The good news is that {page_url}, unlike string from the above function, gets transmitted to Mailchimp! The bad news is that in my case not all page have the “sport name” in the URL :/.
I of course can give you my website’s name in a PM.
Thanks a lot,
Ntel
Hi @ntel,
I’m not sure why the snippets aren’t working… Feel free to email us at plugins [at] yikesinc [dot] com. Being able to see your form might help me better understand the issue.
Thank you,
Kevin.
Thread Starter
ntel
(@ntel)
Just sent, thank you!
Sophie
Plugin Contributor
Tracy Levesque
(@liljimmi)
🏳️🌈 YIKES, Inc. Co-Owner
Hi I am going to close this, since the conversation has moved offline.
Thank you,
-Tracy