Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

barberx on "[Plugin: Contact Form 7] contact form 7 - wpcf7_before_send_mail"

$
0
0

I found this code, but it does not work. My point is that it was after sending the form to add the pdf file as an attachment. Could you give me some advice, what's wrong?

add_action("wpcf7_before_send_mail", "wpcf7_do_something_else");  

function wpcf7_do_something_else($wpcf7) {  

  if ( $wpcf7->id == 276 ) {
    echo 'something';                   

    $pdf_file = 'example.pdf';

    $wpcf7->posted_data['pdf'] = basename($pdf_file);

    $wpcf7->uploaded_files['pdf'] = $pdf_file;

  }  

}

http://wordpress.org/extend/plugins/contact-form-7/


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>