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;
}
}