CRON not sending e-mail

Hello,

My company have a ombudsman system that registers and answers manifestations/complaints.

The system is programmed with CRON set to sent a notification e-mail to the ombudsman professionals when a manifestation/complaint is created by both the SUITECRM system’s manifestation module itself and when its created through the SUITECRM REST API call to create a registry of the manifestation module.

Thing is, the notification e-mail about the manifestations/complaints created directly through the SUITECRM manifestation module are always sent sucessfully, but the e-mails of the manifestations/complaints created throgh the SUITECRM REST API calls only works sometimes, sometimes they stops completely from working and randomly starts working again. We tried restarting CRON multiple times even with the --force argument and the issue persists. We also checked/tested the e-mail configurations and they are working correctly everywhere else.

We are using the SUITECRM version as follows:

Version 7.10.29/

Sugar Version 6.5.25 (Compilation 344)

Are you trying these? Maybe you need to delete it and recreate similar one.

What is this cron job you’re referring to? Is it custom code you developed?

The API doesn’t go through cron. So I guess the problem is in the way that the cron job is using to identify which records got changed or not. You should be able to verify if the cron job is running or not, with logging right at the beginning. If it is, then you can go and verify the rest of the code.

There is also the possibility that cron runs frequently (say, every minute) but takes more than one minute to run. This would cause the jobs to overlap and lots of confusion. You can test this by reducing the frequency (say, every 3 minutes) and it should all work well (although the notifications will take longer to arrive in some cases).

You can also work to reduce the time it takes to run, normally great gains can be obtained by cleaning up the database.

The script at the beginning of this post is great to spot where there might be overgrown tables in the database: