Mautic Integration (Mautic 1.2.4 and SuiteCRM 7.5.1)

BTW, I am already using Mautic 2.14, works as before with some minor improvements. 2.14.1 fixes some moreā€¦
Still no one working on Syncing contacts (I have also adapted and discarded this development, we deal with leads only on the Mautic side and when they are converted they stop updating)

1 Like

Thx. Yes I sync the points field already.

I followed the above steps to link Mautic and SuiteCRM but I get the below error when I click the ā€œAuthorise Appā€ button

Authorization failed with the error message, 'There was an unknown error encountered when trying to obtain the access token.' 

Any ideas???

Iā€™m running Mautic 2.15.0 and SuiteCRM 7.11.2

Letā€™s start with the basics. Did you set up an access token?

Hi

In SuiteCRM I did the following

  • Logged in as admin
  • Went to Administrator -> Admin
  • Went to OAuth Keys
  • Clicked on ā€œCreate OAuth Keyā€ and entered the following
  • ā€”Consumer Key Name - MauticCRM
  • ā€”Consumer Key - MCrmAPI
  • ā€”Consumer Secret - MySecret123
  • Clicked Save

In Mautic I did the following

  • Logged in as admin
  • Went to Settings -> Plugins
  • Clicked on SugarCRM and entered the following
  • ā€”Published - Yes
  • ā€”Sugar CRM URL - https ://crm.example.com (Note I added a space on the URL so it would display on the forum, no space on the real entry)
  • ā€”Client Key - MCrmAPI
  • ā€”Client Secret - MySecret123
  • ā€”SugarCRM username - admin
  • ā€”SugarCRM password - password
  • ā€”SugarCRM Version - 6.x/community
  • Click ā€œAuthorise Appā€

Popup window appears with the below error

Authorization failed with the error message, 'There was an unknown error encountered when trying to obtain the access token.'

Iā€™m running

  • Mautic 2.15.0
  • SuiteCRM 7.11.2

Both on the same server

Canā€™t see any errors in any http access logs or message logs.

Any ideas on what Iā€™ve done wrong?

Many thanks in advance.

OK great, thanks for sharing. All that looks great. Iā€™m on virtually the same set up and I have it working doing the exact same process. (Double checked mine against yours).

Are you 100% sure the key/secret donā€™t have a space a the end after you cut/paste? (Iā€™ve had this problem many times)

Are you 100% sure the username/password is correct (Iā€™ve also done this many times so thatā€™s why I ask).

Hi

Just changed all the passwords to something simple P455w0rd123 as I had previously used passwords with #@ etc in them

That made no difference.

All typed in by hand, no cut&paste extra spaces.

Are you running the same versions as me?

Iā€™m on:

PHP 7.1
(Apache)
SuiteCRM 7.11.2
Mautic 2.15

But Iā€™ve had this working on many previous versions of SuiteCRM and Mautic for over a year at least.

Hmm, I donā€™t see anything wrong with your setup, Have you tried re-setting your file permissions in SuiteCRM? This is always the first thing I do when thereā€™s no obvious problem, and it fixes so many issues.

The user name and password your using is an Admin? Thatā€™s the only other thing I can think of.

1 Like

Putting the mautic site aside, and just looking at the SuiteCRM site.

Is there a way of testing the OAuth setup?

Maybe a URL to navigate to and pass the credentials to; to test for a successful setup?

Maybe a certain log file, to look for errors?

Sorted!!!

pstevens, many thanks for your help, it was greatly appreciated.

My problem turned out to be a silly schoolboy error.
Both the SuiteCRM and Mautic are on the same server. That server was virtualised.
I was trying to get each site to talk to each other specifying their FQDN
That FQDN resolved as the public IP and the vEdge didnā€™t like it.
As soon as I added the FQDN in the local hosts file specifying the private IP so they can talk to each other internally. BINGO!!!

Once again, many thanks for your help.

:slight_smile:

Now I feel bad. I saw this thread keep coming through in my email and was going to respond with some of my biggest reasons for failure.

[ol]
[li]Connection to the SuiteCrm instance from Mautic
[ul]
[li]DNS[/li]
[li]SSL[/li]
[li]Server dates/times[/li]
[/ul]
[/li]
[li]OAuth Configuration[/li]
[li]Server Setups on one side or the other[/li]
[/ol]

P.s. It appears that the plugin still seems to have a bunch of issues. At least Iā€™m seeing things itā€™s simply not doing. If you search for ā€œSugarā€ and ā€œSuiteā€ in Mauticā€™s issue tracker youā€™ll find a lot of open bug issues.

If youā€™re doing the very simple of just pulling in a person or pushing a person and never touching them again, it seems to be working fine. However, Iā€™m having issue with subsequent updates to both ways. And also, for me a big one, if you pull a Contact/Lead from SuiteCrm to Mautic, the SuiteCrm field of ā€œMautic Conact Timeline Linkā€ is never being updated with both Push enabled or disabled.

hello suite-mautic users!

if I use a command like

php ./app/console mautic:integration:fetchleads --integration="Sugarcrm" --fetch-all

and I get a response of

Command to fetch contacts from integration
Fetch contacts command is starting

0 contacts were updated and 0 contacts were created

Updating/creating leads from Mautic to Sugarcrm
Number of contacts pushed: 0 updated, 0 created, 0 had errors and 0 were ignored (likely duplicates or didn't match field criteria)

No leads have been synced from suitecrm instance

  • does this response mean mautic is connecting to suite instance?

  • are there any helpful mautic log files besides error_log in mautic directory?

thank you for any pointers you can offer.

I see ./app/logs/mautic_prod-2019-08-09.php. It includes no helpful info, just an error due to leaving ā€œā€“integration=ā€œSugarcrmā€ā€ out of the console command.

I think thatā€™s an old command, you want:

mautic:integration:synccontacts --integration="Sugarcrm" --time-interval="2 hour"

(in your case you may want ā€œfetch-allā€ once itā€™s done for the first time, switch it to something more reasonable.)

Hello folks,

With the upcoming Mautic 3 release it would be super helpful if any of you would be able to test the SuiteCRM integration - you can download the 3.0-beta-2 installer on github.com/mautic/mautic/releases - please report any issues or bugs either on the Mautic Slack instance (mautic.org/slack for an invite, #mautic-3 is the channel) or directly on GitHub.

Thanks in advance!

1 Like

Where are you putting this? Is this in crontab under the www-data user?

Iā€™ve seen mention of similar lines of code but I canā€™t seem to find where to put it or maybe the directories donā€™t exist.

Iā€™m running:
php7.4
mysql 5.7.4
SuiteCRM Version 7.13.0
Sugar Version 6.5.25 (Build 344)

Iā€™m kind of lost with this Mautic integration. Iā€™ve followed all the instructions I can find. Iā€™ve even tried creating Custom Schedulers but the directories referenced donā€™t exist in my instance and when I create the directories and repair/rebuild the Schedulers page goes blank until I remove them.

You just need to set up cron jobs. There are about 5 or 6 plus the suitecrm sync. Contact your hosting provider about how to setup cron jobs on your web host.

Thanks for the quick response!

Unfortunately I am self-hosting this but I like to think Iā€™m familiar enough to find my way around common linux directories and files.

I have the cronjob in there and it doesnā€™t seem to be working. The cron job responsible for the cron.php that runs the scheduler is working great. The following is what I have in my /etc/crontab file.

* * * * * www-data mautic:integration:synccontacts --integration="Sugarcrm" --time-interval="2 hour"

Does that look right?

Once I get it to work I would change it to run every 2 hours rather than every minute.

and what are the other 5 or 6? where can I find more information about those?

Here are all the cron jobs you need. I normally setup my cron jobs with cpanel so not sure what your issue is with your setup, but I think you might need the path the mautic script in there.

https://docs.mautic.org/en/setup/cron-jobs

I think on newer versions of Mautic itā€™s in /app/console rather than /bin/console if memory serves me correctly.