This is a very dodgy custom hook that lets you take subsmissions on a Ninja Form in your wordpress website and create them as a Salesforce contact on a dummy account.
This is used for a newsletter signup form, because I didn't feel the need to spend $30.00/year on a plugin for this. All these plugins add up, man.
-
You must have Ninja Forms installed - so do this now. I'll wait.
-
Install this plugin
cd /var/www/html/wp-content/plugins/
git clone https://github.com/nicko170/ninjaforms-salesforce
- Activate the plugin in Wordpress Admin Interface
- Under the Ninja Forms -> Salesforce Config menu, configure your connection settings
- Salesforce Domain: This is your Salesforce Lightning Domain, for example, https://internet.my.salesforce.com/
- Salesforce Username: Your Salesforce login email. I recommend using a service account
- Salesforce Password: Your Salesforce login password
- Salesforce Security Token: Your Salesforce User Security Token that bypasses 2FA for APIs
- Salesforce Client ID: Create a Connected App, it'll give you a Consumer Key. Put that here.
- Salesforce Client Secret: Enter the Consumer Secret from the Connected App
- Salesforce Company Name: This will be the name of the company that all form submissions get sent to.
This is the really dodgy part :-)
**Create a Ninja Form, which must have at minimum 3 fields.
- These 3 fields MUST have a label with the following text, they'll be picked up and posted to the contact in Salesforce
- First Name
- Last Name
Under the Emails & Actions settings, add a WP Hook action with the following Hook Tag: ninja_forms_salesforce_action
Test your form, and check your Salesforce.
GNU General Public License v3.0
Feel free to open a Pull Request :-)