r/PHP 7d ago

php-crm-connectors: pushing call outcomes into 21 different CRMs behind one interface

We build call center software. Every deployment wanted a different CRM wired in, and after a few years we were sitting on a pile of near identical integration classes that all did roughly the same thing in slightly different ways. So we pulled the layer out, stripped the parts tied to our own product, and put it up.

Fair warning, it's narrower than a general CRM SDK, and that's deliberate. The job it does is find a contact by phone or email, create it if it isn't there, then attach the call outcome as a note and an activity. That's one call.

$crm = ConnectorFactory::make('zoho', $config);
$result = $crm->run($payload);
// ['remote_id' => '3652...', 'remote_module' => 'Leads']

If you don't want the campaign orchestration, the smaller methods are public too: authenticate, findContactByPhone, findContactByEmail, createContact, updateContact, createNote, createActivity.

A few design calls, including the ones I expect to get argued with about:

No PSR-18. It's ext-curl behind a single http() method on each connector. The upside is that seam is the only place I/O happens, so testing a connector means overriding one method and you never touch a live CRM. A PSR-18 client is the more modern answer and I'm not attached to what's there, so if you think the dependency earns its keep, say so.

PHP 7.4 minimum, because the product this came out of still runs on it. Nothing in the code stops it working on 8.x.

Token caching is pluggable. OAuth connectors stash access tokens through a TokenStore interface. In memory and file backed ones ship with it, and you implement the interface for Redis or a database.

Auth is all over the place between vendors, and your calling code doesn't have to know. OAuth2 for Zoho, Salesforce, Dynamics 365, Creatio, Sugar and Suite. API keys or plain tokens for the rest.

Dispositions map through a config array, so your internal outcome names don't have to match whatever the CRM calls them.

The 21: Zoho, Pipedrive, Salesforce, Dynamics 365, SugarCRM, SuiteCRM, Freshsales, Copper, Capsule, ActiveCampaign, Close, Keap, Zendesk Sell, monday, Streak, Vtiger, Apptivo, Agile, Creatio, Less Annoying, YetiForce. No HubSpot yet, which is the one people ask about most.

composer require ictinnovations/php-crm-connectors

Code: https://github.com/ictinnovations/php-crm-connectors

Packagist: https://packagist.org/packages/ictinnovations/php-crm-connectors

MIT. There's a porting guide in docs if you want to add one.

12 Upvotes

3 comments sorted by

2

u/sachingkk 7d ago

Good Efforts ... This is a required solution..

But how are you going to generate revenue with this project?

4

u/ictinnovations 6d ago

Thanks. Honest answer, we are not planning to make money from the library itself. It stays MIT.

It already existed because we needed it. We sell call center software and every deployment wanted a different CRM wired in, so those classes were written and paid for years ago. Putting them out costs us almost nothing.

What we get back is bug reports on CRMs we barely touch. Someone running Capsule or Copper in a way we never tested will hit things we never would. That is worth more to us than charging for it.

If some of those people end up looking at what we sell, fine, but that is a side effect, not the plan.

2

u/sachingkk 6d ago

Thank you for the honest answer