• Resolved Judge-Mentals

    (@judge-mentals)


    I am using Contact Form 7 on a site where the subscribers are all landing in MailChimp, via the mc4wp plugin.

    There are a number of different forms in play, so people might sign up to different things based on their areas of interest.

    Eg. person 1 might sign up “whitepaper #1” and person 2 signs up to “whitepaper #2”. Down the track, person 1 might also sign up to “whitepaper #2”.

    At some point in time, I am going to want to contact everyone who has signed up to “whitepaper #1”, so am passing tags for all forms. This is working as expected for the individual forms.

    I have found though that I only ever get tagged on the first subscription, so in this instance person 1 only has the tag “whitepaper #1” (when I want them to be tagged later with “whitepaper #2”, when they have signed up to that).

    At some other time, I want to send something to everyone tagged with “whitepaper #2”.

    Is there a way to update / add tags to subscribers that already exist in the MC Audience?

    This is what I am currently passing in functions.php:
    add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
    if ($cf7_form_id == 6) {
    $subscriber->tags[] = 'Overview';
    } else if ($cf7_form_id == 2392) {
    $subscriber->tags[] = 'Whitepaper - Vehicle Emissions';
    } else if ($cf7_form_id == 2395) {
    $subscriber->tags[] = 'Whitepaper - Parking Management';
    } else if ($cf7_form_id == 589) {
    $subscriber->tags[] = 'Other';
    }
    return $subscriber;
    }, 10, 2);

    Thanks!

    The page I need help with: [log in to see the link]

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

    (@hchouhan)

    Hey @judge-mentals,

    Thanks for reaching out to us.

    For tags there is not much UI available. I would recommend using “Interest Groups” as they work the same way as tags, but you can add the fields for user to select in the CF7 form. You can find an example at https://www.mc4wp.com/kb/add-interest-group-choice-contact-form-7/.

    Thread Starter Judge-Mentals

    (@judge-mentals)

    Thanks for the response.
    It feels though that presents me with the same problem as with TAGS. I don’t want to have to have the user select the options manually, so if I include “hidden” inputs that relate to the INTERESTS values, only the first value comes through.

    eg. if I just use the Mailchimp example (ICE CREAM) then when I sign up using the first form, CHOCOLATE comes through as I have a hidden input signifying this as the Interest Group. If I use the same email address to sign up to a different form (where VANILLA is the hidden value), the ICE CREAM group is not updated to CHOCOLATE and VANILLA; it just remains as CHOCOLATE.

    Is there a way to update either TAGS or GROUPS so that I can effectively segment them at a later stage, even for existing subscribers, and keep on adding more TAGS and/or INTERESTS, whilst also using CONTACT FORM 7? Or is this option only available using the baked in MC4WP form?

    Alternatively, is there a way to send a return email to the subscriber using purely MC4WP form, that also contains an attachment? This is a major catalyst as to why I am using CF7.

    • This reply was modified 3 weeks, 6 days ago by Judge-Mentals. Reason: more information
    Plugin Contributor Lap

    (@lapzor)

    You can use this code snippet to set a tag per form:
    https://github.com/ibericode/mailchimp-for-wordpress/blob/main/sample-code-snippets/integrations/contact-form-7/different-tag.php

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

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