function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MadzMadz 

Web2Lead + Php + Database + Email

Hi I managed to create a form to send a lead to salesforce and to add the details to the database.

Do you think it is possible to get the form details by email too? I am on group edition so can't use workflows.

 

Please advise.

 

Thank you.


Here is my setup inside an index.php file:

<?php
require_once('config.php'); // database connection

/////THEN here I put the SQL query////


//then here below is the function to pass the data to salesforce CRM system

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.salesforce.com/servlet/servlet.WebToLead");
curl_setopt($ch, CURLOPT_POST, 1);
// Pass POST data
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($cleanPOST));
curl_exec($ch); // Post to Salesforce
?>
<script type="text/javascript">
window.location = 'index.php?a=1';
</script>
<?php
}
else {
?>
<script type="text/javascript">
window.location = 'index.php?r=1';
</script>
<?php
}
}
?>

// then here comes the form with 
<form name="form" action="index.php" id="sfform" method="post" enctype="multipart/form-data">
////

 





Best Answer chosen by Admin (Salesforce Developers) 
MadzMadz

I managed to do it by by using two seperate curl function and merging them together

 

 

 

 

 

All Answers

AmitSahuAmitSahu

Do you mean that the leads would be created via the emails as well ? If your answer to this questin is yes. Then we can create leads via emails..

MadzMadz

No not by email.

 

the form will send the leads to salesforce, and will add them to the database and will send an email with details to a 3rd party.

 

 

MadzMadz

I managed to do it by by using two seperate curl function and merging them together

 

 

 

 

 

This was selected as the best answer