WP Submitted Email Form - > PDF Attachment

codecanyon

#1

Hello, I’ve been struggling to get FPDF to work along side Contact Form 7 so that my submitted questionnaire/email is automatically converted into a PDF attachment ( and retain it’s html/css formatting).

I’ve come to the point of giving up, are there any plugins that will do all this for me?

for reference this is the code I have implemented into my functions.php file

/**contact form 7 pdf attachment **/ add_action( 'wpcf7_before_send_mail', 'save_application_form'); function save_application_form($cf7) {

/* GET EXTERNAL CLASSES */
require(TEMPLATEPATH . ‘includes/fpdf/fpdf.php’);

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont(‘Arial’,‘B’,16);
$pdf->Write(“Hello, World! Is there anything below this?”);
$pdf->Output(TEMPLATEPATH . ‘/pdf/epdf.pdf’, ‘F’);
$cf7->uploaded_files = array ( ‘attachedfile’ => TEMPLATEPATH . ‘/pdf/epdf.pdf’ );
}

I tried to just create a simple pdf with a hello world string as a test, but my efforts so far have been fruitless.

Thank you


#2

Not sure about the plugins but if you’re looking for some paid support, just let me know.