• Resolved nowton

    (@nowton)


    Does MC4WP map fields to merge tags like first and last name, or is that not an option?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Lap

    (@lapzor)

    The problem with Grafity forms in this regard is that it generates field names sort of randomly, such as name=”input_4″ so it’s hard for MC4WP to know what field is what.

    The only way to do it is if you manually map those field names (you can get them via “right click > inspect” when you view the form) to the correct MailChimp fields with some custom code.

    add_filter( 'mc4wp_integration_gravity-forms_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber ) {
    $subscriber->merge_fields[ "FNAME" ] = sanitize_text_field( $_POST['input_2'] );
    $subscriber->merge_fields[ "COUNTRY" ] = sanitize_text_field( $_POST['input_4'] );
    return $subscriber;
    });

    This example would map input_2 to FNAME and input_4 to the MailChimp field COUNTRY.

    Hope that helps. If you have any questions, please let me know!

Viewing 1 replies (of 1 total)

The topic ‘Gravity forms fields integration?’ is closed to new replies.