What do you want to accomplish?
If you want to replace email contents such as recipient, subject, body etc…
Try using this:
function modify_wpcf7_before_send_mail ( $components, $number ) {
$components[ ‘recipient’ ] = “Replace the recipient”;
$components[ ‘subject’ ] = “Replace the subject”;
$components[ ‘body’ ] .= “Additional text”;
return $components;
}
add_action(“wpcf7_mail_components”,’modify_wpcf7_before_send_mail’, 10, 2 );
This will replace the recipient and subject you entered in the CF. Will also add new lines in body
If you want to see what are the other things you can replace before from the form. Check the file admin-functions.php that can be found from plugins/contact-form-7/admin/includes/ and look for the function wpcf7_save_contact_form
Hope it helps.
Thanks for the reply @mileu – I didn’t have anything specific I wanted to accomplish as I was able to put it together from various resources I found online. I was just curious if there was one single location where the hook documentation was so I could bookmark it for future projects.
I think it would be nice to maybe have it on a github or the WPCF7 official website, just a page or section dedicated to it and how to access certain properties and methods.
I also would like an ‘official’ centralized list of Contact Form 7 hooks.
Currently asking the googles for info, but have not found a comprehensive list.s