Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates Zoho to their REST v2 API #8272

Merged
merged 26 commits into from Jan 30, 2020
Merged

Conversation

alanhartless
Copy link
Contributor

@alanhartless alanhartless commented Dec 31, 2019

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Y
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #7651
BC breaks?
Deprecations?

Description:

Zoho is sunsetting v1 of their API tomorrow. This migrates to v2 of their API. It requires re-authorizing with them.

A portion of this code was provided by Korcomptenz.

Steps to test this PR:

  1. Load up this PR
  2. In Mautic, go to the Plugins page and click on Zoho
  3. Copy the callback URL
  4. In Zoho, register a new client https://www.zoho.com/crm/developer/docs/api/register-client.html to generate a client ID and secret. Use the callback URL copied from Mautic
  5. After saving the client in Zoho, click the vertical ellipsis to the right of the new client and click Edit
  6. Copy the Client ID to Mautic's Zoho config for "Application Client ID" and copy the Client Secret to "Application Client Secret"
  7. Click the Authorize or Reauthorize button
  8. A popup will open requiring you to login with your Zoho credentials then click Allow to authorize Mautic's integration
  9. Map contact and/or company fields with priority facing Mautic
  10. Enable all the features and select Leads, Contacts, and Accounts as objects to sync
  11. Create a campaign with a "Push to Integration" action configured for Zoho and add contacts to the campaign
  12. Execute the campaign and check that the Mautic contacts were created as Leads in Zoho
  13. Now create a few new contacts in Mautic and different ones in Zoho as Leads and others as Contacts
  14. Let the sync execute (run php app/console mautic:integration:synccontacts -i Zoho)
  15. Check that the new contacts in Mautic were synced to Zoho as leads and that the Zoho Leads and Contacts were synced to Mautic
  16. Edit the name of one of the contacts in Mautic and sync again. It should not have synced to Zoho
  17. Edit one of the Leads or Contacts in Zoho and sync. The update should have synced to Mautic.
  18. In Mautic, check the profiles of a contact that was created in Mautic and one that was pushed to Zoho. There should be an entry in the Integrations tab for Zoho with the Zoho ID.
  19. Create an Account in Zoho and it should sync back to Mautic (the existing Zoho plugin does not currently support pushing companies from Mautic to Zoho and this PR does not implement it).

Copy link

@florentpetitjean florentpetitjean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working fine.
the config in Zoho seems to have change a bit though as I don't get the secret directly when I create the client.

use the menu when on the client ID page, and go in the Multi-DC page, here you can find the client secret.

@npracht npracht added pending-test-confirmation PR's that require one test before they can be merged plugin Anything related to plugins labels Jan 13, 2020
@npracht npracht added this to the 2.15.4 milestone Jan 21, 2020
@npracht
Copy link
Member

npracht commented Jan 21, 2020

We use it in production environment since date of the PR. I believe Acquia does the same, i'll mark it as ready to commit.
@alanhartless anything to do with Travis or we should ignore it ?

@npracht npracht added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged plugin Anything related to plugins and removed plugin Anything related to plugins pending-test-confirmation PR's that require one test before they can be merged labels Jan 21, 2020
@alanhartless
Copy link
Contributor Author

@npracht looks like the tests are failing because of maxmind. #8337 will need to be merged and PRs rebased on staging for tests to start passing again.

@npracht npracht added this to Ready to Commit (passed testing) in Mautic 2 Jan 24, 2020
@dennisameling
Copy link
Member

@alanhartless #8337 is merged now. Can you please go ahead and rebase your branch from staging? I don't have permissions for that 😄 thanks!

…d issue that prevented pushing a contact to Zoho through a campaign
…y person existed in Zoho and fixed consumeResponse that did not extract and use the ID of Zoho's newly created lead
…hich was required in order to map contact to Zoho person in the integration_entity table. Since that is no longer available, the mapper has to track that based on the keys returned by Zoho.
@alanhartless
Copy link
Contributor Author

@dennisameling done, hopefully the tests will pass now

@dennisameling
Copy link
Member

@alanhartless just one issue left in Travis:

1) MauticPlugin\MauticCrmBundle\Integration\ZohoIntegrationTest::testPopulateLeadData
'<Leads>\n<row no="">\n<FL val="...Leads>' does not match expected type "array".
/home/travis/build/mautic/mautic/plugins/MauticCrmBundle/Tests/ZohoIntegrationTest.php:168

@dennisameling
Copy link
Member

Thanks for the quick fix @alanhartless and for providing this PR in the first place! I'm gonna go ahead and merge this one for the 2.16 release as @npracht mentioned they've been using it in production for a while already.

@dennisameling dennisameling merged commit 354c67b into mautic:staging Jan 30, 2020
Mautic 2 automation moved this from Ready to Commit (passed testing) to Merged Jan 30, 2020
@dennisameling dennisameling removed the ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged label Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin Anything related to plugins
Projects
No open projects
Mautic 2
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants