You could try to interact with the Salesforce API. Salesforce has great APIs for interacting with its data, but doing that on the WordPress site can be pretty technical. Let’s try to keep this simple.
Let’s just have Gravity Forms send an email to Salesforce with the results of what was entered on the form. This is how Gravity Forms works already for most people. The efficiency problem though is that the usually email ends up in somebody’s inbox and then the data needs to be copy/pasted into another system.
But Salesforce has a way to process this email for you. It is called an Email Service. Here is how this can be done.
1) Create an Apex Class that implements Messaging.InboundEmailHandler
Here is an example piece of code that will accept a Gravity Form email and then parse it into a list that will contain the questions and answers. It would need to be extended for your specific questions and then what action to take. Maybe you want to convert a lead or create an opportunity.
This code is making use of the plainTextBody of the email. You could get the htmlBody too from the email parameter for more detailed parsing, but that is going to contain all of the table tags like
and all of the formatting. I really just wanted to get right at the data for this example.
2) Create an Email Service
a) Go to Setup, Build, Develop, Email Service
b) Click on New Email Service
c) Fill out the form and specify the Apex class that you created above
d) After the Email Service is saved click on the ‘New Email Address’ button to generate an email for this Email Service.
e) This last step is the piece that ties is all together. It is saying that when Salesforce receives this email, that it will route the email to the Apex class that was created above.
That is really all there is to it! Your Gravity Form and Salesforce are now linked!
You will have to be careful about how Gravity Forms sends over tables and other more complicated structures. As you go through the loop you may need to build a set of questions so you know where they start and stop.
I wrote a blog post last week about creating a task with an email service too if you want to look into how to write a test class for your email service.
An email integration is just as powerful as a REST/SOAP integration. It gets the data where it needs to go and it stops the dreaded time-killer of copy/paste work.
Let me know if Sundog can help you with your next integration!