Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Turns out Contact Form 7 has a new way of retrieving the posted data. You replace

    $emailadres = $wpcf7_data->posted_data['your-email'];

    with

    $submission = WPCF7_Submission::get_instance();
    if($submission) {
        $data = $submission->get_posted_data();
        $emailadres = $data['your-email'];
        $wpdb->insert(...
    }

    I found that out by looking through the code of the Contact Form DB plugin which might be a great general purpose plugin for the kind of thing you’re doing.

    Thread Starter adherbst

    (@adherbst)

    I inserted this in KWSConstantContact.php on line 190 and now it works:

    // Update the contact details
    if(is_array($data->lists) && is_array($existingContact->lists)) {
    $data->lists = array_merge($data->lists, $existingContact->lists);
    }
    $modifiedContact = $existingContact->update($data);

    It would be good to have a per-form option for this.

    Thread Starter adherbst

    (@adherbst)

    Solved that problem, but I have another. For the shortcode, I didn’t put echo in front of do_shortcode. It should be:

    <? echo do_shortcode(‘[constantcontactapi formid=”1″ lists=”5″]’); ?>

    Now my problem is that it is replacing the contact’s email lists with the one from the form; I just want it to append it. Is that possible?

Viewing 3 replies - 1 through 3 (of 3 total)