• Resolved magaworks

    (@magaworks)


    Hi, another challenge ??
    Can I add First Name and Last Name separate fields to a single field in Mailchimp?

    With your code do you think this is right? The field “your-fname” is mandatory but “your-lastname” is not. So it might be empty.

    function additional_contact_form_7_data( $merge_variables, $cf7_variables ) {
        if ( isset( $cf7_variables['your-fname'] ) ) {
            $first-name = filter_var( $cf7_variables['your-fname'], FILTER_SANITIZE_STRING );
            $last-lastname = filter_var( $cf7_variables['your-lastname'], FILTER_SANITIZE_STRING );
            $fullname = $first-name . " " .  $last-name;
            $merge_variables['FNAME'] = $fullname;
        }
    }
Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Okay, good. Hmm… Try removing fields one by one. Remove the TOS conditional (comment it out), try subscribing. Does that work? If it doesn’t remove TOS and origem-lp, etc. etc.

    Thread Starter magaworks

    (@magaworks)

    Ok, After some tests finally got it. I was not using your-email.
    I found it strange that the integration worked in one page but not in another page.
    So I went to take a lot at the contact forms, which are identical, except for your-email field.

    FIXED.
    Thanks

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Excellent! Awesome!

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Adding first-name and last-name from contact for to a single Mailchimp Field’ is closed to new replies.