Hi and thank you for this information. I added the username to the post as a custom field. Then using the Contact Form 7 – Dynamic Text Extension plugin I was able to add the username via form tag with hidden CF7_get_post_var key=’se_username’
The third party CRM I am working with provided me with the following code as an example: Originally User ID was going to be used but it has been changed to username.
Would the submission URL be $host?
<?php
// BEGIN FORM HANDLER
function createSELead($params=array()){
$host = 'https://salesengine.se/WebServices/Post/?user_id='.(int)$params['user_id'].'&rec_type_id='.(int)$params['rec_type_id'].'&rec_status_id='.(int)$params['rec_status_id'];
$post = http_build_query($params);
$c = curl_init($host);
curl_setopt($c, CURLOPT_HEADER, 0);
curl_setopt($c, CURLOPT_USERPWD, "se:webservices");
curl_setopt($c, CURLOPT_TIMEOUT, 30);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $post);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($c);
curl_close($c);
return $return;
}
$action = '';
if (isset($_POST['action'])) $action = $_POST['action'];
if ($action == 'process') {
$params = array(
'user_id'=>31060, // SE User ID
'rec_type_id'=>558, // Lead
'rec_status_id'=>177549, // New Lead
'source'=>'Website form - whatever you want here',
'person_first_name'=>$_POST['person_first_name'],
'person_middle_name'=>$_POST['person_middle_name'],
'person_last_name'=>$_POST['person_last_name'],
'person_birthdate'=>$_POST['person_birthdate_day']."-".$_POST['person_birthdate_month']."-".$_POST['person_birthdate_year'],
'person_spouse_first_name'=>$_POST['person_spouse_first_name'],
'person_spouse_last_name'=>$_POST['person_spouse_last_name'],
'person_birthdate'=>$_POST['person_birthdate_spouse_day']."-".$_POST['person_birthdate_spouse_month']."-".$_POST['person_birthdate_spouse_year'],
'person_company_name'=>$_POST['person_company_name'],
'person_primary_phone'=>$_POST['person_primary_phone'],
'person_primary_email'=>$_POST['person_primary_email'],
'person_address1'=>$_POST['person_address1'],
'person_address2'=>$_POST['person_address2'],
'person_city'=>$_POST['person_city'],
'person_state'=>$_POST['person_state'],
'person_zip'=>$_POST['person_city'],
'person_country'=>$_POST['person_country']
);
$response = createSELead($params);
echo '<textarea style="height:300px; width:100%">';
print_r($response);
echo '</textarea>';
echo "<p>Do what you wish with the above response, and URL forward to the Calculator.</p>";
exit;
}
// END FORM HANDLER
I have created the appropriate mapping utilizing the info above. I have also clicked the debugging option but I am not receiving the debug email, any idea what this could be?
Thank you for your time.