• Resolved enkelst

    (@enkelst)


    Hello. I added this snippet of code to add a first name to my form, so I could personalize my emails, but the name doesn’t get added to the contact card – only the email.

    Anyone know how I can fix this? Thank yoooou.

    The page I need help with: [log in to see the link]

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

    (@lapzor)

    Hi.

    I can’t check anything for you because your website is set to “Coming soon”/.

    Please make sure to replace all occurrences of “NAME” in the snippet with the actual merge tag of the MailChimp field you want to capture.

    Hope that helps!

    Kind regards,

    Thread Starter enkelst

    (@enkelst)

    Hi,

    Sorry, had to close the site because it’s still not ready for launch, but your answer helped, and the problem is solved. Thank you so much ??

    Thread Starter enkelst

    (@enkelst)

    Hi Lap, for some reason I had to add the code in the Functions again, and although the code looks right, and the name field appears, the name won’t register in Mailchimp.

    See it here: https://bloggbar.no/

    Have I forgotten something in the code? It looks like this:

    add_action( 'mctb_before_email_field', function() {
        echo '<input type="text" name="*|FNAME|*" placeholder="Fornavn" />';
    });
    
    add_filter( 'mctb_data', function( $vars ) {
        $vars['*|FNAME|*'] = ( isset( $_POST['*|FNAME|*'] ) ) ? sanitize_text_field( $_POST['*|FNAME|*'] ) : '';
        return $vars;
    });

    Thank you for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Added name form field, but it doesn’t register in contact’s info’ is closed to new replies.