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

Pipedrive activities support #7233

Open
wants to merge 24 commits into
base: staging
from

Conversation

Projects
None yet
4 participants
@kuzmany
Copy link
Contributor

kuzmany commented Feb 11, 2019

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

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

Description:

PR added sync Mautic activities (Email read, Page hit, Change segments membership...) to Pipedrive.
This PR added new options to Pipedrive plugin settings and new command
php app/console mautic:integration:pipedrive:pushactivities

Description:

  • If activitiy not exists (Email read...), plugin will create new one https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes
  • Then sync activities to contact profile https://developers.pipedrive.com/docs/api/v1/#!/Activities/post_activities
  • If event name is clickable in Mautic (email, page visits), then will add clickable link to activity description
    image
  • sync by command/cron php app/console mautic:integration:pipedrive:pushactivities - this command use time-interval parameter (default 15 minutes) - prevents sync activities to much often
  • plugin store last_activity_sync timestamp to integration_entity table to column internal. If last_activity_sync doesn't exists, then sync all events , If exists then just sync events from last_activity_sync to now.

image

This PR also improves batch processing for import contacts to Pipedrive:
https://github.com/mautic/mautic/pull/7233/files#diff-b03bbd4c72ad0f3079918af2392a8fd7R92

Steps to test this PR:

  1. Load up this PR and setup Pipedrive plugin https://www.mautic.org/docs/en/plugins/pipedrive.html
  2. setup sync activities to Pipedrive
    image
  3. sync contacts to Pipedrive php app/console mautic:integration:pipedrive:push
  4. sync activities to Pipedrive php app/console mautic:integration:pipedrive:pushactivities
  5. Go to Pipedrive and see activities in each contacts
    image

@kuzmany kuzmany added the Enhancement label Feb 11, 2019

kuzmany added some commits Feb 11, 2019

kuzmany added some commits Feb 11, 2019

@npracht npracht added this to the 2.16.0 milestone Feb 18, 2019

@escopecz
Copy link
Member

escopecz left a comment

I found some small ways how to improve it. TBH I'm a bit scared of the infinite while loops. Maybe if you get the counts first for the progress bars you can change it to for loops.

escopecz and others added some commits Feb 27, 2019

Update plugins/MauticCrmBundle/Api/PipedriveApi.php
Co-Authored-By: kuzmany <zdeno@kuzmany.biz>
Update plugins/MauticCrmBundle/Integration/Pipedrive/Export/Activitie…
…sPipedriveExport.php

Co-Authored-By: kuzmany <zdeno@kuzmany.biz>
Update plugins/MauticCrmBundle/Command/PushActivitiesToPipedriveComma…
…nd.php

Co-Authored-By: kuzmany <zdeno@kuzmany.biz>

Requested changes implemented

@kuzmany

This comment has been minimized.

Copy link
Contributor Author

kuzmany commented Feb 28, 2019

I found some small ways how to improve it. TBH I'm a bit scared of the infinite while loops. Maybe if you get the counts first for the progress bars you can change it to for loops.

What is best practice for did batch command?
Something like in Reports we already done? https://github.com/kuzmany/mautic/blob/424e9cd6dd38bb665b87887a80d501038ba35ebd/app/bundles/ReportBundle/Controller/ReportController.php#L810-L810

Thank you for comments

@escopecz

This comment has been minimized.

Copy link
Member

escopecz commented Feb 28, 2019

We'll test it and update this PR. It may be fine. Thanks!

kuzmany added some commits Mar 10, 2019

@alanhartless

This comment has been minimized.

Copy link
Contributor

alanhartless commented Mar 20, 2019

I tested this and it seems to work. Is there a reason we're expanding the activities here instead of using a multi-select like the other CRM integrations use?

@alanhartless

This comment has been minimized.

Copy link
Contributor

alanhartless commented Mar 20, 2019

Although I'm a little concerned about the scalability of this. Are we concerned about iterating over every mapped contact one by one to find and push activity? This is a very synchronous task that could take a long time for a large number of contacts.

@kuzmany

This comment has been minimized.

Copy link
Contributor Author

kuzmany commented Mar 20, 2019

Although I'm a little concerned about the scalability of this. Are we concerned about iterating over every mapped contact one by one to find and push activity? This is a very synchronous task that could take a long time for a large number of contacts.

Yes, I realized it's not the best way.
What do you suggest?
Create intergration entity for each lead/activity?

I tested this and it seems to work. Is there a reason we're expanding the activities here instead of using a multi-select like the other CRM integrations use?

That were task from David. Saelos do the same https://github.com/mautic/mautic-saelos-bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.