Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer

up vote 3 down vote accepted

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;

}
share|improve this answer
Wow, this is brilliant, exactly what I was looking for. Thank you! – JoseTomasTocino Mar 6 '12 at 19:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.