• Resolved sianab

    (@sianab)


    Hi,
    We are using the MailChimp for WordPress plugin along with Contact Form 7. so far it has been brilliant allowing us to add subscribers to lists, add hidden fields… However, recently, we decided to create a master mailing in MailChimp with many groups (representing the previous lists).

    I have spent all day yesterday looking for a solution (codes) to enable us to hide groups on our form and automatically get subscribers added to the relevant group in our master mailing list.

    We need to keep contact form 7 as it is connected to our CRM. Has anyone found a solution using the MailChimp for WordPress tags?

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

    (@lapzor)

    You can use this code:

    https://github.com/ibericode/mc4wp-snippets/blob/master/integrations/wp-registration-form/add-to-grouping.php

    And change the integration slug from wp-registration-form to contact-form-7

    https://github.com/ibericode/mc4wp-snippets/blob/master/integrations/integration-slugs.md

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

    Thread Starter sianab

    (@sianab)

    Not sure that I understand what I need to be done. So far I have added the code in the Additional Tab of CF7. Is there anything else I should do?

    I am currently having another issue which is my website is not reflecting the change of mailing list I have made.

    I have changed the list value in CF& <input type=”hidden” name=”_mc4wp_lists” value=”adcf2d7e65″ /> and this is saved and show perfectly in the back end. However, when I go the the form page and check the source code I have <input type=”hidden” name=”_mc4wp_lists” value=”449b8faa64″ /> despite refreshing the page.

    So basically I cannot try your solution. : (

    Plugin Contributor Lap

    (@lapzor)

    Here is how to add these code snippets: https://kb.mc4wp.com/adding-code-to-to-your-website/

    Maybe you have some server sided caching, like total cache or rocket that needs to be flushed?

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

    Thread Starter sianab

    (@sianab)

    Not sure I understand what I am supposed to do here

    And change the integration slug from wp-registration-form to contact-form-7

    https://github.com/ibericode/mc4wp-snippets/blob/master/integrations/integration-slugs.md

    Where do I change the slug??

    Thread Starter sianab

    (@sianab)

    Hi Lap,
    So I have done everything you suggested and still no luck.
    I also tried the following https://kb.mc4wp.com/add-group-choice-cf7-forms/ but again contacts do not get added to the relevant group, just to the list.
    : (

    Plugin Contributor Lap

    (@lapzor)

    Please share with is the code you are using now and screenshots of the CF7 form setup and of your MailChimp for WP > MailChimp page with the list folded open so we can see the interest group ID’s.

    Thanks.

    Thread Starter sianab

    (@sianab)

    Thanks Lap to help me out.
    in the function.php file I have the following code:
    add_filter( ‘mc4wp_integration_contact-form-7_subscriber_data’, function( MC4WP_MailChimp_Subscriber $subscriber ) {
    // replace “interest-id” with the actual ID of your interest.
    $subscriber->interests[“2c28058c4f”] = true;
    $subscriber->interests[“6b63fc0e3a”] = true;
    // repeat for all interests you want to enable or disable

    // $subscriber->interests[ “91lxm10xzl” ] = false;
    return $subscriber;
    });

    Below is the CF7 form
    [text* your-firstname class:required placeholder “First Name”]
    [text* your-name class:required placeholder “Last Name”]

    [email* your-email class:required placeholder “Work Email”]

    [text* your-firm class:required placeholder “Company”]

    [tel* your-tel class:required placeholder “Phone number”]
    [textarea* Answer x50 placeholder “Type in your answer”]

    [hidden your-product default:”Training”]
    [hidden your-source default:”Web Site”]
    [hidden your-campaign default:”LLCR-Competition”]

    [acceptance acceptance-831] I have read and accept the Privacy Policy & the Terms & Conditions.

    </p>

    [captchac anti-spam-captcha fg:#8a4b98 bg:#eeeeee size:m]
    [captchar anti-spam-captcha placeholder “Enter the code above”]

    [honeypot honeypot-452]

    <input type=”hidden” name=”_mc4wp_lists” value=”adcf2d7e65″/>
    <input name=”_mc4wp_action” type=”hidden” value=”subscribe” checked=”true”>
    <input name=”mc4wp-INTERESTS[f3e323a4bc][]” type=”hidden” value=”6b63fc0e3a” checked=”true”>

    [submit “Submit”]

    Mailchimp Settings – Mailchimp Settings

    • This reply was modified 6 years, 10 months ago by sianab.
    • This reply was modified 6 years, 10 months ago by sianab.
    Plugin Contributor Lap

    (@lapzor)

    All that code seems fine to me, unles the interest group ID is not correct.

    I think the easiest way is via hidden groups in the CF7 form, so you don’t have to use the code in functions.php.

    https://kb.mc4wp.com/add-group-choice-cf7-forms/

    Thread Starter sianab

    (@sianab)

    Thanks for supporting me.

    I have removed the code from the Function.php file.
    I have followed your instructions in https://kb.mc4wp.com/add-group-choice-cf7-forms/
    and checkd the interest and option id still not working.

    I have tried with and without this addiciotnal line
    <input name=”_mc4wp_action” type=”hidden” value=”subscribe” checked=”true”>and still nothing.

    I am losing the will to live.

    Thread Starter sianab

    (@sianab)

    Could it be possible that I have something wrong with the code a missing _ or something like that?
    Or could something be blocking it?
    <input type=”hidden” name=”_mc4wp_lists” value=”adcf2d7e65″/>
    <input type=”hidden” name=”mc4wp-subscribe” value=”1″/>
    <input type=”hidden” name=”mc4wp-interests[f3e323a4bc][]” value=”6b63fc0e3a” checked=”true”/>

    I just found strange that people get added to the correct list but not the groups.

    Plugin Contributor Lap

    (@lapzor)

    Hi,

    Can you show us a screenshot of your list fields and interest groups, after clicking on the list name on the MailChimp for Wp > Mailchimp screen.

    You can upload the screenshot to https://imgur.com/upload

    Thread Starter sianab

    (@sianab)

    Lap,

    I have downloaded two screenshots (one of the Mailchimp for WP Screen and one of the particular interest group) – https://imgur.com/a/2TAFY

    For the master list I have 5 groups and in total 15 interests (some groups have 2 interest others up to 6)

    Below is the code from the Mailchimp for WP> Form screen for the group I am trying to insert visitors too. (Group = Training Interest, Interests= Contract)

    <p>
    <label>Training – Interest</label>
    <label>
    <input name=”INTERESTS[f3e323a4bc][]” type=”checkbox” value=”0829f55b31″> <span>XXX</span>
    </label>
    <label>
    <input name=”INTERESTS[f3e323a4bc][]” type=”checkbox” value=”333b6ec15b”> <span>YYY</span>
    </label>
    <label>
    <input name=”INTERESTS[f3e323a4bc][]” type=”checkbox” value=”40c82c4ba8″> <span>PPP</span>
    </label>
    <label>
    <input name=”INTERESTS[f3e323a4bc][]” type=”checkbox” value=”4b4cb83c05″> <span>DDD</span>
    </label>
    <label>
    <input name=”INTERESTS[f3e323a4bc][]” type=”checkbox” value=”6b63fc0e3a”
    checked=”true”> <span>AAAA Contracts</span>
    </label>
    </p>

    Thanks for looking into it again.

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    It seems like this issue has been pending for a while. I’ll try my best to assist you in getting this resolved soon.

    Would it be possible to share with us a link to the page where we can test the form? Also, can you please go to “MailChimp for WP > Others” and let us know if any errors are displayed there, after you submit the form?

    Thread Starter sianab

    (@sianab)

    Harish,

    This is the page on which I was testing the Mailchimp groups – https://www.operis.com/campaigns/loan-life-cover-ratio-definition-competition/

    So far there aren’t any errors in the debug log.

    Thanks for looking into this. It would be fantastic if you could get it working!

    Anais

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello Anais,

    Can you please also create a form using our plugin and add it to a test site and share the link with us?

    If possible you can also contact us directly by using the email provided on https://mc4wp.com/contact/.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Mailchimp Groups and ContactForm7’ is closed to new replies.