I am trying to export the values that users input into Contact form 7 in WordPress, to PDF via fpdf. This is what I\'ve set up, I can generate a PDF but without the dynamica
Since version 3.9 of Contact From 7, instead of using $cf7->posted_data, you can retrieve the posted data with:
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$posted_data = $submission->get_posted_data();
}
Now you have an array with the posted data which you can use to generate the PDF file:
/* example code to generate the pdf */
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Times','B',16);
$pdf->Write(5, "My first name is: " . $posted_data['first-name'] );
$pdf->SetFont('Arial','B',16);