• Resolved webmark487

    (@webmark487)


    Hi,

    I am using Contact Form 7 form for newsletter.

    I have a radio newsletter group in Mailchimp with 2 options.

    I could use this now:

    <label>
        <input type="radio" name="INTERESTS[b375325eca]" value="637118571c" required="" checked="true"> <span>Programminfos</span>
    </label>
    <label>
        <input type="radio" name="INTERESTS[b375325eca]" value="9acbcc1460" required=""> <span>Exclusively children's events</span>
    </label>

    BUT:

    How do I get the chosen value into my confirmation emails?

    The square brackets of the name seem to be the problem.

    [INTERESTS[b375325eca]] can not be used in the Contact Form 7 confirmation emails.

    BTW:

    The Contact Form 7 syntax would be similar to

    [radio radio-125 use_label_element default:1 “Programminfos”
    “Exclusively children’s events”]

    With [radio-125] I can use this in the confirmation emails.

    Maybe there is a way to configure the Contact Form 7 syntax, so that the groups are adressed?

    I hope you get what I mean.

    Best regards and thank you in advance

    Markus

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

    (@lapzor)

    Hi,

    Please see https://www.mc4wp.com/kb/add-interest-group-choice-contact-form-7/

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

    Thread Starter webmark487

    (@webmark487)

    Hi, thx for your reply.

    I did already notice, how MC4WP would supply this.

    The problem is: there are square brackets in the name, so I cannot use that in the confirmation emails.

    name=”mc4wp-INTERESTS[ec75a797c8]”

    Plugin Contributor Lap

    (@lapzor)

    Ah sorry I understand now.

    I think you will need some custom code to make that work.

    It might be possible by writing the syntax in a different way so that it can be used, and then convert the submitted data with some custom code at the time it’s submitted.

    Something like this

    
    
    add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
    
    if($_POST['cf7-field-name-here' == 'cf7-value-here']) {
    $subscriber->interests[ "interest-id" ] = true;
    }
    
    if($_POST['cf7-field-name2-here' == 'cf7-value2-here']) {
    $subscriber->interests[ "interest-id2" ] = true;
    }
    
    });



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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Address Mailchimp newsletter groups with Contact Form 7 form’ is closed to new replies.