Has anyone got any further with Salesforce integration? I had yet another call today from a client asking to provide integration between Freeform and Salesforce. I’d vertainly be willing to either help fund development or pay for something that has already been developed.
😊
Hey there,
For a recent client project, we have done quite a bit of integration between EE and SF, using the PHPToolkit (UGH…. If you’ve tried using this, you know what I mean….).
We’ve developed a number of highly customized Plugins, Extensions and Modules, to help:
We were hoping to release a commercial addon for this in the summer, but would rather wait until EE 2.0 is released (and unfortunately, we haven’t received access to the Developer beta, so this may be pushed out even further). :(
That said, is there a particular portion of the SF integration that you’re looking to accomplish? I could try to at least point you in the right direction in the meantime.
Cheers,
Ira
Ira, thanks for getting back to me!
I’m looking to integrate forms (through Freeform I think) to SF. Basically it’s to add new contacts (and add them to a SF mailing list) when people sign up on the website.
Any pointers would be greatly appreciated, as I’m only getting started with it,
John
Hi John,
Looks like you’re really only sending data to Salesforce, and not pulling data from it. This makes things considerably more straightforward, as you wouldn’t even need to install the SF PHPToolkit, Freeform, or CURL on your server.
If you just need to submit the form data as a lead to Salesforce… This could be accomplished using the Salesforce interface to create a Web-to-Lead form, and simply copy the generated HTML code to an EE template on your site. You can create a custom field for the Newsletter signup (in Salesforce) prior to creating the Web-to-Lead form code. You could even set up some rules in SF to deal with the submissions (eg: IF the lead source is YOUR FORM NAME, create a CONTACT from the LEAD… Or, just keep them as Leads, and build a report to display all leads where the custom “Newsletter” field is “Yes/True”…)
If you need your clients to be able to view these form submissions in the EE control panel, AND send the submissions to Salesforce For this, you would need to use Freeform, and it’s a bit more complicated. You would need to create an extension, which hooks into the Freeform submit hook. The extension would allow you to grab the submitted data, convert the field values to the proper Salesforce field names, and send the data to SF just before sending it to the Freeform database.
The second option would require at least Freeform, and CURL installed on your server.
Hope this helps a bit, or at the very least, doesn’t muddy the waters!
Ira
- Integrate the EE login procedure with the SF database, to validate web users as “Customers” or “Customers on active Maintenance” - Create “Product Tokens” in the EE member database, based on assets owned by the SF Account to which the user is associated - Grant access to web users to protected content, based on their Customer type and Product Tokens - Create a “Customer Support Portal” using EE, which displays the logged in user’s Cases, Products (Assets in SF), etc
Ira - This is EXACTLY what one of my clients is requesting. They sell a software as a service product and use Salesforce to manage their customers and leads. If you can provide me with a basic overview as to how you approached this and where to start I’d be eternally grateful. Also, if this is a solution you’d be welling to sell in its current form, I may be interested in that as well.
Thanks for posting this! I’d rather not reinvent the wheel if I can avoid it.
-David
Hi David,
Unfortunately, the code in it’s current form is highly customized for my client, and is not something I’m able to share right now. I’m also in the middle of a site migration this week, so don’t have much time. For now, here’s a rough overview of how it works:
SF PHP TOOLKIT Install the Salesforce PHP toolkit version 11.0 (not the most current version, which requires PHP 5.3 … which is not production ready…. BAD Salesforce…). Make sure that the Toolkit and CURL are working on your server, and that you’ve downloaded the enterprise/partner WSDLs from your Salesforce account.
The Salesforce docs and forums are next to useless for learning/troubleshooting the toolkit, but there’s a great forum here with some good tutorials: http://www.mikesimonds.com/
CONNECTING TO THE SFDC DATABASE You’ll want to create an extension, which uses the ExpressionEngine login hook. In the main part of the extension, you’ll include your PHP connect routine. This routine will:
USING THE CUSTOM DATA Each time a user logs in to EE, the extension above updates the fields in the user’s profile. We can then use this custom data in our templates and/or custom plugins (most often, using “Fresh Variables”).
For example, you could create a “Fresh Variable” (or a plugin) which takes the array of Product Weblog IDs (Product Tokens) for the logged in user, and use them in your templates. This can be done using conditionals (eg: if logged in user is a customer on maintenance, load the content, otherwise, show the login page or error message). You could also use these “Product Token” IDs in your weblog tags (eg: weblog=”my_product_weblog” entry_id=”{product_tokens}” ….. where your fresh variable creates the output like, “23|25|26|30”), so that the logged in user only ever sees content to which they own assets in SF.
“My Products” & “My Cases” You can also create custom plugins, which will pull additional and more detailed data from Salesforce, based on data that we’ve acquired from the login extension. For example, if you record the user’s Account ID and save it to the database, you can create a plugin which:
OTHER USEFUL TOOLS FOR DEVELOPMENT I would also recommend installing the Eclipse development framework, and setting it up for connecting to your Salesforce account. There are some docs on the SFDC site for this. This will allow you to build and test your SF queries in a more visual way, and ensure that you’re getting the proper results before using the query in your extension/plugins.
That’s the gist of it. I also have some advanced settings to allow/deny access to the EE forums on the site, based on Product Tokens.
Hope this helps a bit, and again, sorry that I can’t just share the code at the moment, or give more details. If you are comfortable with creating extensions / plugins, this should at least help point you in the right direction. If it’s a bit over your head, I may have some spare cycles in (late) June for some consulting or development work / sub-contracting for this project.
Best of luck and keep in touch.
Cheers,
Ira
Hehe, I know… I know…
I really can’t distribute the code, as it’s really highly customized for my client, plus they own the code, not me. I will be developing a module/extension/plugin for EE 2.0.
In the meantime, I’d be happy to provide more info or answer any questions you guys have on this.
Ira
I will be developing a module/extension/plugin for EE 2.0. Ira
Ira, how is the extention/mod for Salesforce coming? I have a client proposal I’m putting together, and would really like to be able to use something like this for 2.0.
Let me know (here or pm is fine).
Thanks! Chuck
Sorry to be a pain with all of the cloak and dagger, but, for reasons I can’t get into right now, I will not be developing any 2.0 addons for at least 6 - 8 months.
But again, I would be more than happy to answer any questions on my SFDC / EE integration methods. Since my original posts, we’ve enhanced the integration even more, and are currently developing an “Opportunities” (Sales quotes, totals, quarterly discounts, etc) view as well.
I would recommend just starting by getting CURL, and the Salesforce Toolkit installed, with the customers’ partner or enterprise WSDL. You then have access to all of their Salesforce data, and can build custom SF database (SOQL) queries as needed. Try some test SOQL queries on a regular PHP page somewhere on the site. When it’s returning the proper results, you can start planning on how best to integrate with EE.
For example, we use Plugins for displaying certain repeating data sets (eg: list of products, products under maintenance, cases). The plugin just contains a basic SOQL database query (basically: Select product_name, product_id, maintenance_status, etc, etc, FROM products2 WHERE one of the contact emails is equal to ‘the logged in user’s email’), then in a loop, display the results in a table row.
We use Extensions for some of the fancier bits, where on login for example, we take the user’s email, look up that email in SFDC, and pull all of their info from SFDC and decide if they are currently customers, if they are customers with active Support Contracts, and if so, create a ‘token’ in a custom member field, which gives them access to certain sections of the site (support dashboard, cases, product downloads, forums, etc). The sections are selectable in the Extension settings.
That’s the gist of it. Again, post away if you run into any problems. We’re also available for official project consulting if needed.
Cheers,
Ira
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.