• Resolved Florent Maillefaud

    (@florent73)


    Hi!

    I find this code for choose send attachement :

    add_filter( ‘wpcf7_mail_components’, ‘your_custom_callback_function’, 10, 3 );
    function your_custom_callback_function( $components, $contact_form, $mail ) {
    if ( ‘mail’ == $mail->name() ) {
    // do something for ‘Mail’
    } elseif ( ‘mail_2’ == $mail->name() ) {
    // do something for ‘Mail (2)’
    }

    return $components;
    }

    It’s not working for me.

    Erreur is PHP Warning: Missing argument 2 and PHP Warning: Missing argument 3 for cf7_sendpdf::your_custom_callback_function()

    PHP Fatal error: Call to a member function name() on a non-object for $mail->name()

    Can you explain this ? Where is the problem ?

    Thanks a lot

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Choose send attachment’ is closed to new replies.