Created
November 26, 2019 13:12
-
-
Save fieldoffice/e3f6f4772ba7c8e2fa9cf8da88e3c2ae to your computer and use it in GitHub Desktop.
Send Formidable form data to Pardot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('frm_after_create_entry', 'sendToPardot', 30, 2); | |
function sendToPardot($entry_id, $form_id){ | |
if($form_id == 5){ // Form ID | |
/* You can create as many variables as you need, the last number is the field ID number | |
that you get from the Build or Settings tab of your form */ | |
$pardotEmail = ($_POST['item_meta'][10]); | |
$pardotFirst = ($_POST['item_meta'][11]); | |
$pardotPhone = ($_POST['item_meta'][12]); | |
/* In Pardot you specify whatever External Field Name you want. | |
Use those field names in the URL string below along with | |
the variables you specified up above. */ | |
$result = wp_remote_post('https://youlinktoyourpardotformhandler.com/?email='.$pardotEmail.'&name='.$pardotFirst.'&phone number='.$pardotPhone); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment