Support » Plugin: Easy Forms for Mailchimp » Adding first-name and last-name from contact for to a single Mailchimp Field

  • Resolved 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


    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.

    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.


    Plugin Contributor yikesitskevin


    Excellent! Awesome!

Viewing 3 replies - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.