Contact Forms 7 add PDF in php
-
I want to add a PDF using PHP to the Contact Form 7 email in WordPress (with the ultimate aim of changing this into a dynamic PDF). I’ve done a lot of looking around forums but I can’t get it to work. Any help would be much appreciated ??
add_action( 'wpcf7_before_send_mail', 'create_pdf_and_send_it' ); function create_pdf_and_send_it( $cf7 ) { //check if this is the right form $id = $cf7->id(); if ($id==41){ define ('MY_FILE_PATH',$uploads['path'].'/2018/04/'); $submission = WPCF7_Submission::get_instance(); $submission->add_uploaded_file('pdf', MY_FILE_PATH.'/test.pdf'); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Contact Forms 7 add PDF in php’ is closed to new replies.