Contact Form 7 – process form using a PHP script, instead of mailing [closed]
IT Nursery
May 2, 2022
0
I want to use a form from the Contact Form 7 plugin to allow the users to upload a document to my website. The problem is that I’d like to manage those uploads from WordPress instead of receiving them in my E-Mail.
Is there a way of redirecting the output of those forms to a PHP script, or something similar?
2 s 2
Take a look at the wpcf7_before_send_mail hook CF7 provides.
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else_with_the_data");
function wpcf7_do_something_else_with_the_data(&$wpcf7_data)
{
// Everything you should need is in this variable
var_dump($wpcf7_data);
// I can skip sending the mail if I want to...
$wpcf7_data->skip_mail = true;
}