Support » Plugin: Contact Form 7 Extension For Mailchimp » Special mail tag stopping form from submitting

  • Resolved scatmandon

    (@scatmandon)


    I’m trying to use the [_post_title] special mail tag send the post title that a form was submitted from to MailChimp as a merge field.

    It did work but is now causing the form to fail to send with the following php error…

    PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function wpcf7_special_mail_tag(), 2 passed and exactly 3 expected in
    /nas/content/live/w4pv/wp-content/plugins/contact-form-7/includes/special-mail-tags.php:9\nStack trace:\n#0 [internal function]: wpcf7_special_mail_tag(”, ‘_post_title’)\n#1 /nas/content/live/w4pv/wp-includes/class-wp-hook.php(286): call_user_func_array(‘wpcf7_special_m…’, Array)\n#2 /nas/content/live/w4pv/wp-includes/plugin.php(208): WP_Hook->apply_filters(”, Array)\n#3 /nas/content/live/w4pv/wp-content/plugins/contact-form-7-mailchimp-extension/lib/functions.php(139): apply_filters(‘wpcf7_special_m…’, ”, ‘_post_title’)\n#4 /nas/content/live/w4pv/wp-content/plugins/contact-form-7-mailchimp-extension/lib/functions.php(206): cf7_mch_tag_replace(‘/\\\\[\\\\s*([a-zA-Z_…’, ‘[_post_title]’, Array)\n#5 [internal function]: wpcf7_mch_subscribe_remote(Object(WPCF7_ContactForm))\n#6 /nas/content/live/w4pv/wp-includes/class-wp-hook.php(288): call_user_func_array(‘wpcf7_mch_subsc…’, Array)\n#7 /nas/conte in /nas/content/live/w4pv/wp-content/plugins/contact-form-7/includes/special-mail-tags.php on line 9

    If I remove the special mail tag from the data I’m attempting to submit to MailChimp it sends fine, but that information is crucial.

    Any idea what’s causing this?

    Thanks,

    Dan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Greetings,
    I’ve just run into this also, the contact form 7 wpcf7_special_mail_tag
    function takes 3 arguments but the plugin only provides two. I edited contact-form-7-mailchimp-extension/lib/functions.php line 139 to pass in an empty string for the ‘html’ field and it’s now working for me

    if ( $special = apply_filters( ‘wpcf7_special_mail_tags’, ”, $matches[1], “” ) )
    return $special;

    @oliverhtml this worked! This 100% needs to be added to the next plugin update!

    @zamartz No problem, glad it helped someone!

    Plugin Author Renzo

    (@rnzo)

    Please update to the latest version

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