https://github.com/codeadamca/react-forms-salesforce
A basic example of submitting form data from a React.js form to the Salesforce WebToLead.
https://github.com/codeadamca/react-forms-salesforce
react salesforce-api
Last synced: about 2 months ago
JSON representation
A basic example of submitting form data from a React.js form to the Salesforce WebToLead.
- Host: GitHub
- URL: https://github.com/codeadamca/react-forms-salesforce
- Owner: codeadamca
- Created: 2022-10-05T17:54:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T22:06:12.000Z (over 1 year ago)
- Last Synced: 2025-03-31T07:18:46.251Z (over 1 year ago)
- Topics: react, salesforce-api
- Language: JavaScript
- Homepage:
- Size: 581 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Salesforce API and a React Contact Form
A basic example of submitting form data from a React.js form to the Salesforce WebToLead.
This eample uses the [react-forms](https://github.com/codeadamca/react-forms) and the [php-env](https://github.com/codeadamca/php-env) repos as a starting point.
The Salesforce WebToLead form was intended to process an HTML form submission to add customers to the Salesforce database. The WebToLead processing was not build to work with an AJAX request and is susceptable to CORS. This example sends the form data to a PHP proxy file which sends the form data to cURL to bypass CORS.
You will need to update the .env file with your Salesforce OID and redirect URL aong with updating the fetch URL to match the location of your proxy.php file.
***
## Repo Resources
* [react-forms](https://github.com/codeadamca/react-forms)
* [php-env](https://github.com/codeadamca/php-env)
* [Salesforce Web to lead](https://www.salesforce.com/ca/products/guide/lead-gen/web-to-lead/)