I'll try and keep it simple, because there's a lot of moving parts.
I've come up with the following pattern:
This pattern is close, but what I'd like to do is call into an API to create a lead in Salesforce.
Ideally, what I'd like to do is hook up some custom javascript when the Contact Form 7 form is submitted. I could then use jquery ajax to call into an API to generate the lead. I'm very new to Wordpress and PHP, but have a lot of experience with javascript/jquery, and web development through ASP/MVC... so it's a matter of finding the right place to do this sort of logic in the backend PHP.
Any pointers are much appreciated.
I think the easiest way to achieve this is to hook into the submit function of your contact form. This way, you can just simply send over your data through the Salesforce API.
add_action( 'wpcf7_before_send_mail', 'my_cf7_form_submit' );
function my_cf7_form_submit( $cf7 ) {
//logic to post to SalesForce API.
}
This will only fire after they've submit the form and right before the wpcf7 plugin sends out the notification emails.
Hopefully this helps.