Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Add attachment with WPCF7_ContactForm class

  • I am making a plugin/hook for Contact Form 7 that makes a pdf of the form and mails it. I managed to generate a pdf with TCPDF (www.tcpdf.com). This pdf is generated in wp-content/uploads/wpcf7_uploads.

    How can I add the pdf as attachment to the mail? I tried the following, but the pdf file was not attached to the mail.

    add_action('wpcf7_before_send_mail', 'wpcf7_makepdf');
    
    function wpcf7_makepdf(&$wpcf7_class) {
    	...generate pdf...
    
    	$wpcf7_class->posted_data['pdf'] = basename($pdf_file);
    	$wpcf7_class->uploaded_files['pdf'] = $pdf_file;
    }

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • fyi, there’s another topic about this here: http://bit.ly/c4rkk3+

    djlo

    (@djlo)

    Hello, just wondering if anyone managed to have a .pdf created from a contact form that users submitted? @josjojo, were you able to do this?

    josjojo – did you ever get this working? Would you care to share your code or plugin? I desperately need to turn a form into a PDF and mail it to clients when submitted. Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Contact Form 7] Add attachment with WPCF7_ContactForm class’ is closed to new replies.