An open API service indexing awesome lists of open source software.

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.

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/)