Mailchimp questions

Home Forums Quform WordPress Mailchimp questions

This topic is: resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #34047
    veganwebagency
    Participant

    Hello,

    We would like to ask you a few questions regarding your Mailchimp add on plugin:

    Overwriting data
    If we specify all the fields in the settings but some of them aren’t mandatory we got a problem of overwriting with empty data. So if someone has his phone number entered in Mailchimp and fills out the form again with an empty phone numer it’s gone in Mailchimp.
    Is there an option to ignore empty values and only send entered?

    Custom Merge Fields
    Same problem with the address fields in your custom filter.
    If he only fills out “addr” we don’t want that Mailchimp removes the values of the other fields if it has some.

    add_filter('quform_mailchimp_integration_merge_fields_1', function (array $mergeFields, Quform_Form $form) {

    $mergeFields['ADDRESS'] = [
    'addr1' => $form->getValueText('quform_1_11'),
    'city' => $form->getValueText('quform_1_14'),
    'zip' => $form->getValueText('quform_1_12'),
    'country' => 'CH'
    ];
    return $mergeFields;
    }, 10, 2);

    Pass form value as tag
    We would like to transfer a value that is selected in a select field in the form as a “tag” to Mailchimp.
    We tried it with “{element|id:4|category}”, but unfortunately without success.

    Sorry for all the questions, but you guys are the best!! 😉

    Best Regards,
    Chrigi

    #34056
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #34072
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    • This reply was modified 2 years, 1 month ago by Ally. Reason: Changed config to setConfig when setting tags
    #34081
    veganwebagency
    Participant

    Hi Ally,

    Thanks for the answer.

    The logic with the tag is working fine 🙂

    But it’s still overwriting the address data if it’s send empty.
    Was it working on your side?

    Best Regards,
    Chrigi

    #34082
    veganwebagency
    Participant

    We have tested a little more.

    – If you fill in all fields and send it it works.
    – If you leave all fields empty and submit it overwrites everything.
    – If you fill in only one field like “addr1” nothing happens.

    #34088
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #34089
    veganwebagency
    Participant

    Hi Ally,

    Thank you for your clarifications.

    We have implemented it as you suggested and it works fine.

    Thanks a lot!
    Best Regards,
    Chrigi

    #34102
    veganwebagency
    Participant

    For all future readers, Mailchimp has now defined the “state” field as mandatory as well, so the correct code would be:

    
    $mergeFields['ADDRESS'] = [
        'addr1' => $form->getValueText('quform_1_11'),
        'city' => $form->getValueText('quform_1_14'),
        'state' => $form->getValueText('quform_1_15'),
        'zip' => $form->getValueText('quform_1_12'),
        'country' => 'CH'
    ];
    
    if (empty($mergeFields['ADDRESS']['addr1']) || empty($mergeFields['ADDRESS']['city']) || empty($mergeFields['ADDRESS']['state']) || empty($mergeFields['ADDRESS']['zip'])) {
        unset($mergeFields['ADDRESS']);
    }
    
    
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy